Many people have problems with Wi-Fi when they get a new phone, and the Galaxy S6 is no exception. There are a lot of possible causes of a Wi-Fi problem. You may find that the connection is slow, maybe it just does not connect, or maybe it continues to descend the connection at random.
Turn your S6 and router off, and then turn them back on. Often this works, but it is rarely a permanent solution.
Go to Settings> Wifi, long press on the problematic router, then touch Forget network, and test your start up from scratch.
If you connect to 5GHz and there is a 2.4GHz option, try switching to see if it makes a difference.
Use a free application like Wifi Analyzer to make sure your channels are not too crowded. If you find that you are using a busy channel, then try to switch - It could make a big difference.
Check that the MAC filter on the router is off or add your Galaxy S6 MAC address. You should find it in Settings> Wifi> More> Advanced.
Make sure that Keep Wi-Fi during sleep is set to Always. You will find it in Settings> Wifi> More> Advanced.
Make sure the router firmware is up to date. Check with your Internet service provider or the manufacturer for updates.