Add (or subtract) 360 degrees as many times as it takes to get a number between 0 and 360. This is an angle coterminal with your starting angle. Let's call the measure of the coterminal angle: C.
The reference angle will be:
C if C is between 0 and 90
(180 - C) if C is between 90 and 180
(C - 180) if C is between 180 and 270
(360 - C) if C is between 270 and 360.
For your angle we need to subtract (since 945 is greater than 360) and we need to subtract 360 twice:
945
-360
---
585
-360
---
225
So an angle of 225 is coterminal with an angle of 945. Since this is between 180 and 270, the reference angle is 225 - 180 = 45.