A Technical Machine, or TM for short, is an item that is used to teach a Pokémon a move. A Hidden Machine, or HM for short, is also an item that is used to teach a Pokémon a move.
TMs and HMs can be found in a variety of places, such as lying on the ground or bought at department stores. Some TMs are also given away by Gym Leaders as prizes for defeating them. They can be used multiple times, so only one of each will be obtainable.
The moves contained within an HM can not be forgotten by Pokémon under normal circumstances. All HM moves and some TM moves can be used in the field by a Pokémon even if the Pokémon has fainted during battle or has run out of PP (using it in the field does not consume PP). Specific Badges must be obtained by the player before they can use an HM move outside of battle.