Your computer remembers DNS answers for a while. After a DNS change, flushing this cache makes it look up the new answer.
Windows
Open Command Prompt and run:
ipconfig /flushdns
macOS
Open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux (systemd-resolved, e.g. Ubuntu)
sudo resolvectl flush-caches
Browsers
Browsers have their own cache too. Close and reopen the browser, or in Chrome visit chrome://net-internals/#dns and click Clear host cache.
Your router and internet provider also cache DNS, which you can't clear; these expire on their own.