The two ways are Natural energy (Windmill energy, Solar energy, Wave energy, etc....) and chemical energy (thorium, plutonium, uranium, etc....).
Lets take Solar energy for example, it absorbs electrons from the sun and converts the electrons to be stored in batteries. From there it can be used for any appliances.