You put in a marker to where the link will go to and then reference that in the link itself. To take some one to the top of your page put:
<a name="top"></a>
in the HTML code at the top of the page. Then use this link:
<a href="#top">Back to top</a>
to get them back to the top. For any other location on the page do the same thing, but obviously name each instance differently. What you name the links doesn't matter, but it's a good idea to use something that lets you know where the link goes to in case you edit the page in the future.