Check the back/side of your router if its the default code. Otherwise login to the router through the adress bar at 192.168.0.1 and enter the credentials. If all else fails, just reset the router physically, there is often a small hole to stick a pin inside and push a reset button that u hold for 10 seconds or something. Then the password and ssid will revert to the default one thats usually available on ur router, this includes the credentials to login to the router to change its settings including changing the ssid and password.
If u have a printer connected wirelessly u can also use ur pc to make the printer print out a page of all its settings which will include the WiFi ssid and password