How to apply .diff and .patch file by SSH?
After logging in to your site with SSH, in order to apply patches, you should have or install a program on your server. patch is the most widespread one, but you can also use git for it.

You can find more documentation on applying patches in the Drupal site: https://www.drupal.org/patch/apply