The favicon file format is quite specific.

The FAQ says:
Note: the icon typically needs to be 16x16 px, and your graphics program needs to be able to generate .ico files suitable for this purpose.
There are other formats such as 32x32 etc which can be used as alternatives for various purposes. You can google for favicon to find more tips and tricks on generating these alternative formats.
There are various software tools available for creating favicons. There are some handy freeware tools online. Some of the traditional graphics programs can create them too -- consult the online help of your favorite graphics program to see if it can save in the correct format or not.