This scene comes directly after Hamlet has met and spoken with his father's ghost. If I understand your question correctly, you're looking at what he needs to do in order to set things right in Denmark. The biggest thing he needs to do is to take revenge upon his father's "foul and most unnatural murder." Additionally, Hamlet must stay away from doing anything with or placing any blame on his mother. The ghost says:
But, howsomever thou pursues this act,
Taint not thy mind, nor let thy sould contrive
against thy mother aught: leave her to heave
and to those thorns that in her bosom lodge
to prick and sting her.
He tells Hamlet this so that he won't break his concentration on his most important task.
Finally, Hamlet is tasked with setting Denmark on the correct path again.