Hello, there are several possible reasons for a WiFi connection that sometimes doesn't connect straight away. It may be from the following:
On your side
Microwave interference
Too many people on the network
Too many people physically in the room + too many objects obstructing the signal
Your location in relation to the router
A low quality router
Router overheating
Router poorly positioned
Router cables bent, undertension.
It could also be from your Internet Service Provider...
Try making sure any of the things that are under your control are in order before looking at your ISP (because they will just ask you to make sure everything is working properly on your side first).