Note the equal sign. What you do to one side, you do to the other. Isolate the p. Do the opposite of PEMDAS.
first, subtract 5r from both sides
2p + 5r (-5r) = q (-5r)
2p = q - 5r
Next, divide 2 from both sides
(2p)/2 = (q - 5r)/2
p = (q/2) - (2.5r) is your answer
hope this helps