Run a program as another user

I have a bash script that launches another problem. I need to run that program under a certain user account. The script itself is run using 'sudo <scriptname>'.

#!/bin/bash
myprogram=...
exec "$myprogram"

How would this be done?

Run the script with 'sudo -u username' instead of just sudo. Don't need to do anything special inside the script.