1. You're doing something wrong. Then do it right. When in doubt, tell exactly what you did. Is WiFi enabled in the settings? Did you choose the right router and enter the right password? Do you have connection with your router? Without such a connection you certainly can't go to the Internet via the router.
2. The new tablet is defective. Then you can get a new one under warranty.

If you happened to buy this tablet in a brick-and-mortar shop, go back and let the sales guy have a look and show you how to connect to the shops WiFi. Such support is more difficult if you bought it on the web. Then you're on your own or have to rely on friends to do it for you.