If you have a lot of heat, then you can do what power plants do - you can use the heat to generate steam, and use the
steam to spin a turbine. The turbine can drive a generator which produces electricity. This setup is very common,
but it requires a fair amount of equipment and space.
If you would like to generate electricity from heat in a simple way that has no moving parts, the normal way
to do it involves thermocouples. Thermocouples take advantage of an electrical effect that occurs at
junctions between different metals. For example, take two iron wires and one copper wire. Twist one end of the
copper wire and one end of one of the iron wires together. Do the same with the other end of the
copper wire and the other iron wire.
If you heat one of the twisted junctions (for example with a match) and attach the two free ends to a volt meter,
you will be able to measure a voltage. Similarly, if you hook the two iron wires to a battery, one junction will
get hot and the other will get cold.
Interplanetary satellites that fly toward planets like Jupiter and Saturn are so far away from the sun
that they cannot use solar panels to generate electricity. These satellites use RTGs (Radioisotope Thermoelectric Generators)
to generate their power. An RTG uses radioactive material (like plutonium) to generate heat, and thermocouples
convert the heat to electricity. RTGs have no moving parts so they are reliable, and the radioactive material generates
heat for many years so they last a long time.
Here's several interesting links: