The book version of "The Wonderful Wizard of Oz," which was written by L. Frank Baum, ends in very much the same way that the movie starring Judy Garland ends. In both, Dorothy Gale makes her way back to Kansas by means of magic. In both, she has to click her heels together three times and then wish. In both, she returns home to a joyous welcome.
In the book, Glinda the good witch tells Dorothy that she has the power to return home by using the shoes. Dorothy does, but loses the shoes during the journey back to Kansas.