How were castles heated?
Castles built after about the year 1200 could be built with chimneys, which were new technology at the time, and could be heated by fireplaces in the various rooms. This was not common, however.
Most castles were heated by building fires on hearths or braziers in the middles of rooms and allowing the smoke to rise to the roof and be vented from there. This meant that the rooms that were heated had to be big enough and high enough for such a fire, and this was the reason a castle would have a room in it called the Great Hall. One of the reasons castles were drafty was that venting the fire required the equivalent of an open window at the top of the room. Other rooms were normally not heated.
Smaller rooms could be heated by using a hearth at the side of the room if the wall was made of stone and the hearth had a smoke canopy. A smoke canopy was a device that gathered the smoke to vent it out through a hole in the roof or wall. I have seen a number of pictures of them, but all of these were in kitchens. They may have been used in some other rooms, but it would appear it was not a common practice. The related question below on smoke canopies has links to pictures.
There were places, particularly Spain, where an ancient system of heating was maintained and used in castles. In this system, called a hypocaust, a fire was used to heat an air space under the floor. Such a system was expensive, and in most of Europe people probably did not even know about it.
There are links below.