You can edit the hosts file with any text editor. There are a variety available, but both Windows 10 and 11 come with Notepad ...
If you see There was an error while attempting to read the local hosts file, Event ID 1012 in the Event Viewer of your Windows 11/10 computer, follow the solutions ...