The magical device used for time travel in the Harry Potter books is called a Time-Turner.
Hermione Granger uses a Time-Turner in Harry Potter and the Prisoner of Azkaban so she can attend more classes than would normally fit into one school timetable. The device resembles a small hourglass on a chain. Each turn of its central mechanism sends the user back one hour, according to the explanation given in the novel.
Harry and Hermione later use Hermione’s Time-Turner to revisit events at Hogwarts, save Buckbeak, and rescue Sirius Black. The story establishes limits and risks around changing the past. In later books, the Ministry’s Time-Turners are destroyed during a battle in the Department of Mysteries, although the series later introduces additional time-travel complications.