Where and why is the comet’s tail directed?

Most comets have their tail directed away from the Sun under the influence of light pressure and the pressure of the solar wind.
Some comets have anomalous tails pointing towards the Sun. In some comets, this direction is apparent due to the peculiarities of the projection of the tail onto the celestial sphere. In others, anomalous tail direction results from physical processes in the nucleus.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.