How to change the page with code?

Hi. I know this is probably a very simple question, but I’m new to JavaScript, I’ve always used Luau. How would I change the page that the user is on with code? I have a button that already checks if some inputs have a certain text, and I already used a console.log so I know when it is clicked and if it is correct BUT when it is pressed and it is in a certain state, what line(s) of code could I use to switch the page that the user is on?

Thanks.