The best and most secure way would be to set up key authentication
to that remote server so that you don't have to provide a password. If you cannot (or don't want to) go that way (which is the most secure) you could use a tool like sshpass
that can be used to pass on your password to ssh from within a script. Using sshpass your password will be visible in the script so limit access to the file/computer you're using it on or encrypt your script when you've found it functional.