In my textbook, there is a solved example:
Prove that $A \cup (B \cap C) = (A \cup B)\cap(A\cup C).$
Solution
Let $x$ be an arbitrary element of $A \cup (B\cap C)$. Then, $$ \begin{aligned} &x\in A\cup (B\cap C)\\ \implies &x \in A \lor (x\in B\cap C)\\ \implies &x \in A \lor (x\in B \land x\in C)\\ \implies &(x \in A \lor x\in B) \land (x\in A \lor x\in C)\\ \implies &x\in(A \cup B) \land x\in(A\cup C)\\ \implies &x\in((A\cup B)\cap(A\cup C))\\ \therefore\ A\cup(B\cap C) \subseteq (A\cup B)\cap (A\cup C) \end{aligned} $$ Similarly, $(A\cup B)\cap (A\cup C) \subseteq A\cup(B\cap C)$.
Hence, $A\cup (B\cap C) = (A\cup B)\cap(A\cup C)$.
The book didn't prove $(A\cup B)\cap (A\cup C) \subseteq A\cup(B\cap C)$. So, I tried to do it:
Let $y$ be an arbitrary element of $(A\cup B)\cap(A\cup C)$. Then, $$ \begin{aligned} &y\in(A\cup B) \land y\in(A\cup C)\\ \implies &(y\in A \lor y\in B) \land (y\in A \lor y\in C)\\ \implies &((y\in A \lor y\in B)\land y\in A) \lor ((y\in A \lor y\in B)\land y\in C)\\ \implies &((y\in A \land y\in A)\lor (y\in B\land y\in A))\lor ((y\in A \land y\in C) \lor (y\in B \land y\in C)) \end{aligned} $$
I don't know how to proceed further. There could be a better way to prove this, but I just want to simplify this expression into something that could enable me to solve the problem.