Bed-Knob and Broomstick
by Mary Norton.
A well-written little book for early or pre-teens which has apparently been made into a Disney film.
Three English children befriend Miss Price, a local witch, and blackmail her: they’ll keep her secret (that of being a witch) if she gives them magic. She refrains from turning them into frogs (she’s a good person, after all), and accepts the agreement by making their bed magical: it can teleport anywhere & anywhen.
Needless to say, the kids have various misadventures with the bed. Finally they bring a 1611 necromancer to the present time. He and the witch like each other, and she eventually moves back in time to be his wife. The book ends with the girl being able to see and hear the by now 300-year-dead Miss Price puttering about in the garden, happy with her new life.