What you need is a favicon.ico file.
Just put it in the root of your site and link to it in the header of your page
<head>
<title>My Site</title>
<link rel="shortcut icon" href="https://stackoverflow.com/questions/3103490/favicon.ico" />
</head>
You should put it in the root of your site and name it favicon.ico because some browsers look for it even if you don’t link to it on your pages.