In order to change the file extension of a file on Windows 11, follow the following steps:
1: configure Windows to display the file extensions of files on File Explorer. This is necessary because the file extensions are hidden by default.
2: now that the file extension is displayed as part of the filename of files in the File Explorer, all you need to do is rename the file, but changing only the file extension. For example, if you have a file called photo.gif, you can change the file extension to .png simply by renaming it to photo.png. After you do this, Windows will show you a dialog box warning you that the file may become unusable.

Warning: while this warning is a bit dramatic, there are cases you can make the file unusable if you don't know what you are doing. See ["If you change a file name extension, the file might become unusable"] for details on what the risks are to your data.
3: click "Yes" to change the file extension.
Tip: if you changed the file extension by accident and you forgot what it was before, you may be able to undo it by pressing Ctrl+Z inside the File Explorer. This will undo the last operation, which includes renaming, moving, or deleting files.