Why solids conduct better heat than liquids and gases ?

The main reason is that solids are packed closely, so that vibrations of energy can be transmitted from atom to atom much more efficently than in a gas or liquid.