But every time I copy and paste it the terminal doesn’t seem to work properly. I noticed its possible to paste a few at a time without losing responsiveness but thats going to take forever.
Although I would argue there are better ways to achieve this (like using ublock origin on browser and blocking them there) perhaps easier way to achieve this is something like:
Download file locally (txt)
Inspect contents to be sure nothing fishy is injected
You also failed to show the use of sudo
As your regular user in your home directory cat /etc/hosts hosts.txt > newhosts followed by sudo cp newhosts /etc/hosts would probably have worked.
Thanks to @mhdave for noting an error in the way I originally formatted the command.