MacBook – WiFi can not connect in MacOS, but rebooting Windows does not work?

I have a MacBook Pro 2017 running macOS 10.14.3.

At home, I have a wireless router connected to multiple devices, including my MacBook. Recently, my MacBook had trouble connecting for some reason. If I manually select the network in the Wi-Fi menu, it will try to connect for a few seconds, and the error message "Unable to connect can try to come closer" (or similar) will be displayed without any additional error information. What exactly is this Problem.

After many attempts, he finally manages to connect to the network, but it works ping (the IP of my router) or ping, most packages have a timeout or it takes a response of 1s.

If you move closer to the router, the problem is not resolved.

Other devices (such as my iPhone) can be connected and work properly.

I can connect to my iPhone through hotspot, but the network performance is more or less the same. RingIt's terrible, even though surfing the internet with mobile data on my iPhone works well.

I also have Windows 10 installed on my machine via Boot Camp. When I restart Windows, I connect and Ping works great. This makes me believe that something is wrong with macOS, which causes this problem.

I understand that this is probably one of the issues that are not easy to solve since the problem can be caused by a number of things. But can anyone suggest something that I can try to diagnose the problem? Can I somehow "reset" the network stack?