Heat transfer can take place through three different mechanisms: conduction, convection and radiation. In conduction, heat is transferred through direct contact between bodies. Since direct contact is possible in solids, liquids as well as gases, conduction can take place in all of them. However, solids are more tightly bound than other forms of matter and hence conduction is better in the solid state, as compared to other forms of matter. If we heat one end of a metal stick, the other end will also feel hot after a while, due to conduction.
Convection is the transfer of heat energy through the movement of fluid particles. Hence, convection cannot take place in solids, since the solid particles are not fluid. Thus, convection only takes place in liquids and gases. The boiling of water in a pan happens because of convective heat transfer between water molecules.
In comparison, radiation does not require any medium for heat transfer. Solar radiation is an example of radiation or radiative heat transfer.
Hope this helps.