You can edit the hosts file with any text editor. There are a variety available, but both Windows 10 and 11 come with Notepad ...
For MacOS go to System Preferences -> Network. Choose the current local area connection and hit the Advanced button. Then, go to DNS tab and press the + button. One has to then type in the new IPv4 or ...