Basically, spacecraft can be powered by energy stored in a battery or fuel cell and released as the craft travels, or it can be generated as the journey progresses. There are several ways to store and make energy. These include:
Batteries which store energy made on Earth and release it as electricity.
Solar panels which convert light from the Sun into electricity.
Radioisotope thermoelectric generators, or RTGs, which uses the fact that radioactive materials, encased in a sealed shell, will generate heat as they decay into non-radioactive materials.
Fuel cells which are somewhat like batteries, storing power in the form of separated oxygen and hydrogen. A thin membrane between the two elements harnesses the energy separated when the oxygen and hydrogen combine to form water.
Ask any question below to learn about how spacecraft are powered.
What are radioisotope thermoelectric generators?
Are radioisotope thermoelectric generators safe?
What are batteries?
What are fuel cells?
What are solar panels?
How do solar panels supply energy for spacecraft?
How does DS1's electrical system work?
What are tradeoffs between different kinds of power sources for spacecraft?
How do batteries work?
What are the fuels for radioisotope thermoelectric generators?
How are solar panels made?