Many laptops even have a button (wifi or airplane mode) right on the keyboard somewhere that you can do that with. Even if they don’t, you can probably click on the wifi icon in the taskbar to bring up an Airplane Mode toggle switch.
Find the part of your apartment where the signal is the strongest and put a repeater there and have your computer connect to the repeater’s wifi. Since the repeater’s wifi signal will presumably be strong, even if the main wifi goes out, the computer will still be connected to wifi. (It won’t be able to reach the internet while the main wifi is still out.)
Does your laptop have an Intel Wifi chip? I had a cheap Lenovo laptop with Intel Wifi that continually dropped packets, even though I was 5 feet from the router. I could ping Google.com and watch it at ~12ms for 10 pings, then timeout for 10, then ~12 ms again, back and forth.
After a lot of research my eventual solution was to buy a USB Wifi adapter that used a Realtek chipset, internet is rock solid now.
Glad that fixed your problem but very sorry to see another case where the Intel Wifi doesn’t do it’s job. Not sure if it’s a hardware or software problem. I’d suspect software.