How to check if the ssh connection is established?

I have used the SSH activity to connect to the Remote server.
How to check whether the connection is established or not.
If the connection is not established to the particular host, I need to establish the connection to the different host, so the automation won’t be stopped.
How this can be archived?