The most common reason is that you don't have Java installed. Your PC doesn't know which app to use and often mistakenly chooses WinRAR or Internet Explorer. That's why the file icon looks completely different. You need to get Java setup for Minecraft in order to open the OptiFine file. Jarfix can also help, to make sure that all .jar files will be opened with Java in the future.