To send a remote command via SSH (the SSH server needs to be running on the remote host), you can simply write the command after user@machine.
ssh [email protected] echo 'Hello World'
Hello World
It returns back the output to the sender, executed on the remote host.