I know my password and username but it says invalide username and password
Either you've (1) entered the credentials incorrectly, (2) remembered them wrong or (3) someone has gained access to the router and changed them.
You can solve this problem only if you have physical access to the router. You should locate the reset button on the router itself. This may be recessed to prevent accidental contact, and if so - will require depressing it with a pointed object such as a pen. Performing a reset will wipe all customized settings and restore the router to factory defaults. This means you will not have wifi access to the router or internet *if* you have changed it from the original factory setting. If you are attempting this via wifi, you will need to know what those wifi settings are or connect the computer via CAT 5 network cable to one of the LAN jacks or ports on the router. Once you have found the the default wifi settings - or - have plugged the computer into a LAN jack, reboot the computer. Next, press and hold the reset button for 30 seconds while it is plugged in & powered up.
This will start the restoration of the factory default settings and cause a reboot the router. The PC will obtain an IP address automatically if connected by cable - or prompt you for the wifi's SSID and security code after it boots up. Enter the wifi factory defaults to gain access to the router and internet.
Next, gain access to the router's "set up" pages. The set up page is usually access by opening your web browser and typing 192.168.0.1 or 192.168.1.1, or similar private IP address in the address bar. Your manual will have these details. If successful, you will be prompted to provide the router username and password. Again, the factory defaults are in your manual - popular username defaults are "admin" or "root" and popular passwords are: ""admin" or "password"
If successful, you're "in". You should make changes as necessary to prevent others from gaining unauthorized access - again. Do not reuse any of the previous credentials if possible. This means you should (1) change the password (and admin if allowed) fields to something only you would know and do not use words that appear in a dictionary. A mix of upper and lower case letters, numbers and symbols should be used. (2) Change the SSID to something other than the default. (3) Choose the option of NOT broadcasting the SSID. (4) Select WPA or WPA2 security. WEP is NO longer considered secure and should not be used. (5) Create another "password" for the WPA security as prompted. You will have to update every device that you wish to give access to the internet; this includes laptops, tablets, game consoles, wifi enabled cell phones, etc. You can make other changes as needed - as these are only the bare *minimum* changes you should make. Be sure your changes are saved before moving to other set up pages or rebooting the router.
Finally, write down the router's admin, password, SSID, security type (WPA or WPA2), security code and the IP address on a small piece of paper. Tape it to the underside of your router. This way, it will remain out of view but readily available to you should you ever forget this information and will save you from having to do all of this again.
Good luck!