HMs are basically moves that take up a move slot but also allow you to solve puzzles in the game by using them on your Pokemon for them to use in the field. Examples are Strength which allows you to move large boulders around and Surf which allows you to traverse water. You need a Pokemon that knows an HM if you want to use it and once they do, they will never forget it (unless specified).