It starts from nuclear fusion happening through making hydrogen into helium. This process is a process made from energy known as nuclear potential energy. The atoms in the sun have the potential to create lots of energy.
This compression created coal out of the plants. The miners use chemical potential energy from their food and turn it into motion energy to mine this coal.