I've had my Samsung Galaxy S6 for a year and a half now, without any major problems.
But recently it started disconnecting from my home WiFi network. In the WiFi settings only 5GHz networks are available. When I reboot the phone, I can use normal networks without a problem for maybe a day, until the 2.4GHz networks disappear again.
It can still be the modem/router. Sometimes, when one the internet goes down, or the modem goes out for a moment, anywhere from 1 to all devices will not gain the connection again when it starts back up. Happens all the time.
It doesn't just disconnect from the network, it doesn't detect it anymore in the WiFi settings (the 2.4GHz one). I've restarted the router and the modem countless times, activated and deactivated the 5GHz and 2.4GHz networks, but nothing worked.
It's a problem with the phone.
I see. Then it may well be a hardware issue, unless it started after a specific app install, then I would be leery of that app. If it is hardware, then fixing it may not be an option. If it is under warranty still, contact the manufacturer as they may well replace it.
Either way you go though, be sure you back up all your personal files and data off of the device somewhere (cloud account, computer, etc.) that way you don't lose anything.