What happens as a comet approaches and moves away from the sun?

As a comet approaches towards the sun it becomes warm. Then as it moves away from the sun, it forms a glowing tail and extends over 100 million km.

Please tell me if this is correct, thanks

Yes, that is generally correct! When a comet approaches the sun, it starts to heat up due to the increasing intensity of sunlight. The heat causes the frozen gases, such as water, carbon dioxide, methane, and ammonia, within the comet to vaporize, creating a glowing coma (a fuzzy, bright area around the nucleus) and a tail.

As the comet continues to move closer to the sun, the solar wind, which is a stream of particles emitted by the sun, blows the gas and dust particles away from the comet's nucleus, creating a beautiful, glowing tail that can extend for millions of kilometers in the opposite direction of the sun.

However, it's worth noting that the exact behavior and appearance of a comet can vary depending on its composition, size, and other factors. Additionally, comets can have multiple tails and the tails can change over time as the comet's orbit and proximity to the sun change.