You could look carefully at the similarities and differences between the left and right sides of the equations.
However, a pattern is hard to determine.
I have a good way to memorize the formulas for the sine and cosine of the sum and difference of two angles.
sin (theta ± phi) and
cos (theta ± phi)
Pretend you are a cheerleader....
"sine, cosine, cosine, sine... cosine, cosine, SIGN, sine sine."
By "SIGN" I mean, change the sign (positive/negative).
"sine, cosine, cosine, sine" is the right side of the sin (theta ± phi), keeping the sign the same.
"cosine, cosine, SIGN, sine sine" is he right side of cos (theta ± phi), changing the sign in the middle.
But for the product-sum formulas, I know of no way other than hard work.
Bottom line:
How do we memorize the product-to-sum identities?
We don't.
We look them up as needed.
I would be very surprised if a teacher requires you to memorize them.