It is literally just a text file on your machine. If you’re on macOS it’s the /etc/hosts file. You add the entries to the file and that is all there is to it.
Also, google is your friend. Try searching for “how to edit hosts file Windows” or “how to edit hosts file Linux”