The best way you can do it is turning off power management for the wireless adapter;
Power Management Settings for the Wi‑Fi Adapter
Windows might be turning off your network adapter to save power. To disable this behavior:
Open Device Manager:
Right-click on the Start button and select Device Manager.
Find Your Wi‑Fi Adapter:
Expand **Network adapters**.
Right-click your wireless adapter (it might be named something like "Intel(R) Wireless" or "Realtek Wireless") and choose **Properties**.
**Adjust Power Settings:**
Go to the **Power Management** tab.
Uncheck the option **Allow the computer to turn off this device to save power**.
Click **OK**.
This ensures that Windows doesn’t disable the adapter during sign-in or in idle scenarios.
If you found it helpful, could you kindly click the “Accept Answer and upvote” on the post.
If you have any further queries, please let us know we are glad to help you.