You could also use an image editor to create your favicon file. A few editors I like are IrfanView and Gimp.
Even by putting your favicon.ico file in the root directory of your domain ie. yourdomain.com/favicon.ico, your browser should automatically find it without the code, though the W3C recommends that you use the code that CodemasterX wrote.
