In act 1, scene 4 of Shakespeare's Hamlet, the Ghost of Hamlet's father appears to Hamlet, Horatio, Marcellus, and Bernardo, but he doesn't speak to them. Instead, in scene 5, the Ghost leads Hamlet away from the others to another part of the castle.
The Ghost tells Hamlet that he only has a short amount of time before he has to return to Hell, and he tells Hamlet to pay close attention to what he has to say.
The Ghost then tells Hamlet that it was Claudius, Hamlet's uncle, who killed him, and demands that Hamlet swear to avenge his "foul and most unnatural murder" (1.5.29).
The Ghost tells Hamlet how Claudius killed him, and leaves Hamlet with the words, "Adieu, adieu, adieu! Remember me" (1.5.96).
Hamlet falls to his knees, and in a short soliloquy he calls on Heaven, earth, and even Hell to help him keep his promise to his father's ghost and to help him seek revenge against Claudius:
O all you host of heaven! O earth! What else?
And shall I couple hell? O, fie! Hold, hold, my heart!
And you, my sinews, grow not instant old,
But bear me stiffly up. Remember thee? (1.5.96–100)
Hamlet vows not only to remember his father and what his father told him but to devote his life to avenging his death:
I'll wipe away all trivial fond records,
All saws of books, all forms, all pressures past,
That youth and observation copied there;
And thy commandment all alone shall live
Within the book and volume of my brain...
Now to my word:
It is ‘Adieu, adieu! Remember me.’
I have sworn't. (1.5.104–117)
Horatio, Marcellus, and Bernardo have been searching for Hamlet, and when they find him, he demands that they swear on his sword not to tell anyone about what they've seen or heard. With prompting from the Ghost under their feet telling them to "Swear!", they swear.