In short, if you are locked out, you cannot manage the device.
Disclaimer: This is an advanced step. Do not use this for routine maintenance.
You can manage the password directly from the printer's control panel: Press the button.
This is the most effective method for the WF-C5790 when the password is blocking the UI: