Allright, I have done some research on this problem as Apple has not provided an actual fix. This problem seems to affect quite a number of people but no update has fixed it as of yet. Here are some potential fixes to try, on my Mac Pro I got around this problem by setting Wi-Fi over Ethernet in Network Settings -> Set Service Order, as I found that only the Ethernet connection cuts off. Now my connection isn't as stable as with Ethernet as the priority, but at least it works all the time.
In Network Settings, you can right click your Wi-Fi or Ethernet and click Delete Service, then Add Service by clicking the three dots below, and add the Wi-Fi/Ethernet back again. I found that this fixed the connection temporarily with my Ethernet, but I had to redo this every time the connection dropped.
Some people have gotten rid of this by disabling/deleting all VPNs and/or the Private Relay in Settings -> iCloud -> Private Relay to Off.
Also, I found one user who fixed this by running the command sudo rm /var/db/timed/com.apple.timed.plist because the Macs internal clock was off.
It's worth a shot to renew your DHCP lease as well, go into Network Settings, click on your Wi-Fi/Ethernet, go into the TCP/IP section, and click on Renew DHCP Lease, it has worked for some.
Try these out and see if any of them fix it for you, I don't have a perfect solution yet but one of these fixes could do it with your Mac! Hopefully this will be fixed completely in an update soon.
Please, reply to this comment if any of these work for you and what kind of Mac you run. Apple has not as of yet, as far as I know, acknowledged this problem at all even though I have found numerous people in different forums all around the internet talking about this, and it seems to affect Intel and Apple Silicon computers, just not everyone.