How do bodies maintain temperature?

In humans, the activities of our cells use energy and produce heat as an effect (kind of like light globes producing heat as well as light). Then that heat is passed into the environment by our wastes etc. (they're hot), or it just radiating off (eg. when you can feel the heat of another body, they're losing heat!).

When we get cold, we can also shiver. The reason for this is that the increased amount of contractions of the muscles (cells) also increases the heat produced in the method mentioned at the start of this (very long) answer (haha).
The same applies for when we exercise: More cell activity=more heat.

We can also gain heat through the sun, or anything else that feels hot. That means that when you feel heat, that heat is passing into your body. It also works in reverse: When you feel something cold, it's taking heat from you.

Hope I helped :) I do (yr 11) human biology and physics :p