The file has to be in ICO, EXE, DLL, or ICL format ... Select the right icon and click “Open.” Click “OK” on both windows after that, and the desktop icon should change.
In Windows 10 and Windows Server 2019, it may happen that File Explorer does not display the offline file icons correctly. You can identify an offline file by the overlay that shows an “x ...