Okay, take a look at diagram 1 (I know it's rubbish I did it on paint :D), this shows all the information you've given in the question. The two coordinates and the distance between them.
Now if we draw additional lines on this diagram, we can make a right-angled triangle (this is on diagram 2). We can also work out the lengths of the additional sides because we know both coordinates at the end-points of the additional lines.
Finally because this is a right-angled triangle, Pythagoras' theorem must apply to its sides meaning



therefore x=5.