Since you indicate that you are only interested in contrasting Hamlet and Horatio, then I will assume that you are looking for ways in which they are different, or moments when they come into conflict with each other.
The first moment in which there is contrast between them, is when Hamlet insists, in Act I, scene iv, upon following the Ghost wherever it might lead. Their (abridged) exchange goes like this:
It will not speak. Then I will follow it.
Do not, my lord.
Why, what should be the fear?
. . .I'll follow it.
What if it tempt you toward the flood, my lord,
Or to the dreadful summit of the cliff. . .
And draw you into madness?. . .
Go on, I'll follow thee. . . Hold off your hands.
Be rul'd; you shall not go.
By heaven, I'll make a ghost of him that lets me.
I say away -- Go on. I'll follow thee.
In this scene, the two characters can be contrasted by the rash, headstrong, and reckless way that Hamlet is determined to follow the Ghost versus Horatio's cautious, more logical and somewhat fearful warnings.
The other moment in which there is obvious contrast between them is in Act V, scene ii, when Hamlet has received the challenge from Laertes and determines to accept the wager. Again, an abridgement of their conversation:
You will lose, my lord.
I do not think so. . . Thou wouldst not think how ill all's here about my heart; but it is no matter.
Nay, good my lord. . . .If your mind dislike anything, obey it. I will forestall their repair hither and say you are not fit.
Not a whit. We defy augury. . .Let be.
In this scene, Hamlet senses some danger or potential treachery, but chooses to ignore it, or go forward, even as he is aware of it. Horatio, on the other hand, would have him play it safe and avoid the potential danger, again operating from a more logical, reasonable and "safe" perspective than Hamlet.
For more on how to create an essay in which you compare and contrast characters, please follow the "how to write" link below. There is also a link to an essay comparing Hamlet and Horatio, for more on this topic.