For coal, the energy is stored in the form of chemical energy, which comes from the plants that were buried millions of years ago and compressed under layers of rock. These plants originally got their energy from the sun through the process of photosynthesis.
For wind, the energy comes from the movement of air, which is caused by the uneven heating of the Earth's surface by the sun. The sun heats the land more than the water, and the air above the land becomes warmer and rises. This rising air creates wind, which can be used to generate electricity.