What is the model number of the laptop and what OS is installed?
Some things to try to see if the problem can be narrowed down or resolved:
a. Try resetting the TCP/IP network stack and check if that resolves the problem.
If Win 10 is the OS, in the search box on the taskbar (click Start), type command prompt, right-click the command prompt result and then select Run as administrator and confirm.
In the Command window type the following commands one at a time and press Enter after each command and wait for a response before entering the next command. Yes there is a space between the words and the / character but not between the / character and the next word. If you make a typing error use the backspace key and retype the word or letter etc. Some of the commands may take a little while for a response and do not restart the laptop until all the commands have been entered (even if a response says to do it)
Type ipconfig /release and press Enter key.
Type ipconfig /flushdns and press Enter key.
Type ipconfig /renew and press Enter key.
Type netsh int ip reset and press Enter key.
Type netsh winsock reset and press Enter key.
Close the Command window and restart the laptop in the normal manner and check if the problem is still there.
b. Try using the laptop in safe mode with networking and check if the connection can be achieved. If it does a 3rd party program may be causing the problem. Check what programs are loaded when starting the laptop. In normal mode right click on the Taskbar and select Task manager > Startup to view what programs are being loaded when starting the laptop and check if they are necessary or not. Some may be for correct operation so be careful. Check online what the program is for if you’re not sure. If you think that it may be a problem, right click on a program in Startup and select “disable’ and then restart the laptop and check the WiFi. If still no good right click on the program again in Startup and select enable to restore it again etc
c. Try using the laptop as close as possible to the router to check if the connection can be achieved and that it is stable. If so it may be an antenna problem in the laptop.