There's a huge difference between YELLING at your dog and sternly commanding "No!" Obviously the puppy-class instructed didn't clarify this well enough to you. You should never yell at a puppy because, as you've discovered for yourself, it scares them and can do permanent psychological harm.
You'll need to bond with your dog to get them to trust you again, take long walks and practice giving commands like heel, sit and stay. Reward positive actions with pats and soothing words and when you need to correct your puppies actions just speak in a firm, commanding voice, you don't need to yell for your dog to understand you, they actually have pretty good hearing.

Good luck.