Forget and reconnect the network
A network that keeps dropping ? In Settings > Wi-Fi, “forget” the network then reconnect with the password. Also test another network (your phone’s personal hotspot) : if that one works, the problem is with your internet router, not the Mac.
Reflex : restart the internet router (unplugged for 30 s) — the No. 1 cause of drop-outs.