I tried that and it didn't fnish changing it because I lost connection with the router. so how am I supposed to change it if it doesn't complete the process
If the password change isn't completing then you're going to need to use a device that's connected with an Ethernet cable to change the password of the particular WiFi band (2.4GHz or 5GHz), or be connected to the opposite band of the one you're changing the password for.
Some changes will take when you're connected to the band you're changing, but others won't, and evidently, the password is one of the ones that won't.
AMD FX-6100 | Samsung 250GB 840 EVO SSD | Western Digital Blue 500GB HDD | 16GB DDR3-1866 | EVGA Geforce GTX 550ti | Windows 10 Pro 64-bit