There's lot's of online converter for this.
Search Google for : how to make .ico file
Most people use the Telegraphics Favicon plugin
Note you need to have the right image sizes, so:
If you want to assign an icon to a hard drive, place the .ico file in its root directory along with an Autorun.inf file created in Notepad.
So the drive appears in My PC as:
I have used this plug-in in the past, but can't find where to install it in the latest version of photoshop cc 2017. The directions say to put it in C:\Program Files\Adobe\Photoshop \Plug-Ins\File Formats, but that folder doesn't exist there. As many people use this file format, I can't believe that Adobe hasn't already made it a standard feature! Ticks me off to have to use a different program.