A star is a huge ball of mostly hydrogen
that has compacted from gravity until it gets so
hot that the hydrogen starts to fuse into helium.
You may have noticed that when you pump up the
tire on a bicycle, the tire can get warm. This
heat comes from the act of squeezing the air
into the tire. When gravity starts to compress
a cloud of hydrogen gas it gets hot in the same
way. But there is a lot more hydrogen so it gets
much hotter. Eventually it gets so hot that it
becomes like a hydrogen bomb and starts making
helium and releasing enormous amounts of energy.
When it first fuses hydrogen into helium it
becomes a star.
Even the biggest planets are much smaller than
stars. Planets never fuse hydrogen. But big
planets like Jupiter do get hot from gravity's
compression of gas. Jupiter, Saturn, Uranus, and
Neptune are all much hotter than they would be if
they were warmed only by the Sun.