You can use a truth table, or you can just argue that both sides have the same truth value. Here's a sketch:
The left is true
(p iff q) and (r iff q) are both true
p, q have the same truth value AND r,q have the same truth value
p,q and r have the same truth value
p, r have the same truth value
the right hand side is true.
Remarks: (1) iff stands for "if and only if"
(2) I did this very quickly, so make sure that all these steps are reversible. If there is an error it should be easy to correct - the basic idea is sound (I'm running out of the house now or I would check it more carefully).