How you change a server password depends on the operating system and the current access method you are using. In most cases, you should log in directly to the server and change the password there rather than waiting until access is already broken.
After changing a password, update any saved credentials in management tools, SSH clients, automation systems, or team documentation that still references the old value.
Use strong unique passwords and avoid reusing credentials across multiple systems.