This is going to be a VERY rough calculation as to how much energy it would take to freeze an entire galaxy. Okay so first up, the sun is 1.989 × 10^30 kg. It is also ~73% Hydrogen and ~25% Helium. The rest is immensely smaller proportions of other elements, but the third most prominent element in the sun is Oxygen, so I'll use that for the remaining 2%.
The surface temperature of the sun is 5,800 K and the core is 15.7 million K. I'll average it out and get 7,852,900 K, or 7852626.85 degrees Celsius.
Helium has the lowest freezing point of the three elements listed above, so you'll have to lower the sun in its entirety to that temperature to freeze all of it. Thus, I'll use -272.2 degrees Celsius to find the change in temperature for each element.
Freezing all of the Oxygen[]
2% of 1.989 × 10^30 is 3.978e+28 kg. E = M * c * ΔT E = Energy M = Mass (kg) c = Specific Heat Capacity ΔT = change in temperature (Celsius) We use 919 for the SHC of Oxygen, and its freezing point of helium is -272.2 degrees C. This makes the change in temperature 7,852,899.05 degrees Celsius, using the average heat of the sun that I got above. 3.978e+28 * 919 * 7,852,899.05 = 2.8708487e+38 Joules. That's around low-end Brown Dwarf level.
Freezing all of the Helium[]
25% of 1.989 × 10^30 is 4.9725e+29 kg. The SHC of Helium is 5.19 Kj/Kg*k, or 5190 J/Kj*k. 4.9725e+29 * 5190 * 7,852,899.05 = 2.0266193e+40 Joules. That's low end Small Star level.
Freezing all of the Hydrogen[]
73% of 1.989 × 10^30 is 1.45197e+30 kg. The SHC of Hydrogen is 14,120. 1.45197e+30 * 14,120 * 7,852,899.05 = 1.6099869e+41 Joules. That's still Small Star level.
Add 'em all up...[]
1.6099869e+41 + 2.0266193e+40 + 2.8708487e+38 = 1.8155197e+41 Joules, which is still Small Star level.
Multiply[]
A quick google search tells me that there are 100 billion stars in a galaxy. 1.8155197e+41 * 100,000,000,000 = 1.8155197e+52 Joules, which is Solar System level.