No matter which method you choose, your MacBook needs to stay awake and unmuted for the alarm to sound. Go to System Settings > Battery > Power Adapter, and set the “Turn display off after” slider to a longer time, or check “Prevent automatic sleeping on power adapter.”
I know, I know—that’s bad for battery life and screen longevity. But if you need that alarm, it’s a necessary evil. Or you could just, you know, buy a real alarm clock.