A Technical Machine, or TM, is an item that teaches a Pokémon a specific move, numbered like TM24 for Thunderbolt in Generation I, with compatibility varying by species. Hidden Machines, or HMs, were the field move counterpart used from Generation I to VI.
TMs have existed since Pokémon Red and Blue, and for four generations they were single use: teach the move once and the disc was gone, which made strong TMs such as Earthquake genuine decisions. Gym Leaders traditionally hand out their signature move as a TM after you beat them, so the TM list doubles as a record of your progress. Generation V made TMs reusable without limit, which removed the scarcity and changed team building for the rest of the series in the games that kept that rule.
HMs taught moves usable outside battle, Cut, Fly, Surf, Strength, and others, and using them in the field required the matching Gym Badge. HM moves could not be forgotten by normal means, only through the Move Deleter, which trapped many players with a weak move on a main team member for a whole game. Generation VII retired HMs in favor of ride Pokémon and secret techniques, and later games never brought them back.
Generation VIII split the system again in Pokémon Sword and Shield: reusable TMs plus TRs, Technical Records, which are single use like the original TMs and carry many of the strongest moves. Generation IX made TMs craftable at the TM Machine in Pokémon Centers using materials dropped by wild Pokémon, so a TM is now something you build, then spend.
In play"Use that TM on someone who actually needs it, you only get one in this game."