I ran into the same problem yesterday.
Everything was good in the morning, then after I came back from lunch, all of sudden I couldn't connect to internet!
I googled a lot and basically tried EVERY approach people suggested online but none of them worked. Eventually I decided to replace the wifi adapter and see if it'd work. And it worked!
I never thought that a wifi adapter could die in normal use. But hey I realized a fact that might be the cause - weak wifi signal. Yes, I've been using my computer in a distance from the router for about 4 years. The wifi signal strength has been one (sometimes two) bar less from full all the time. I guess that increases the wifi adapter's work load? causing too much heat? not an expert so just guessing.. So if you happen to be in the same situation, maybe consider replacing the hardware.
Computer: Dell PC
OS: Windows 11
Old wifi adapter: Qualcomm Atheros
New wifi adapter: Intel Killer