Assuming you have already logged into the server, run the following command to locate your SSHd config file:
That command will give you the location of your SSHd config file, usually /etc/ssh/sshd_config
Now open up that config file using your favorite text editor, we'll use nano.
The bit of information we're interested in looks like this:
Change port number (22) into a different one with 3-4 digits e.g. 4421, then it should look like this:
Save the file, exit the editor, and run this command:
If that command gives you an error, try:
If you have done everything correctly, SSH should already work on a new port.