There are many reasons for this problem; one of the reasons is that Windows Update failed to install or update the Network drivers, in that case, you have to update the required driver manually.
Ethernet connection or wired connection is better as compared to WiFi, in my opinion, but then like everything else, an Ethernet connection can stop working. If you do not have an alternate way to ...