On a remote server I can execute a certain command only via "sudo". The authentication is done via a certificate. So when I login via SSH by a bash script, python, ruby or something else, how can I execute a certain command with sudo?
The proper way of doing this is using a configuration management solution, like ansible, You can use become directive to run script/command with sudo privileges from  a remote client.
If there is only one box or you need to schedule, you can use /etc/crontab and run it with root user at desired interval.
How can I execute a command with "sudo" in a python/bash/ruby script via SSH?