Why don't you start by telling us what your current level of understanding is. If you look up the thryroid in your textbook (or even on a basic public education website), you should find a basic description of its physiology. Your basic med reference should also be helpful.
Review those and then come back with specific questions. Your current question is the equivalent to asking, "Can someone explain lung functioning to me?" It's a little too general for people to know where to start. The thryroid regulates metabolism -- and when it is not functioning properly, the metabolism gets out of whack -- either too high or too low. For people whose thryroids are not producing the correct amount of hormones, medications can help restore the correct balance of hormones ... and consequently, an appropriate metabolic rate.