I’m always cautious of advising people that they absolutely-positively need to take a class. Put simply, you don’t. At all. But it might help.
Do what works for you. For some people, a class gets them writing, gets them writing better, keeps them motivated, keeps them improving. For other people, it might be going to talks by their favourite writers, or following writers and writing-advice folk on Twitter. It might be reading books about writing, or following an agent’s blog. It might be reading good books, the kind that inspire them to write something just as good; it might be reading terrible books, the kind that push them into writing something better. It might be listening to music or going for a walk or meditating or doing the dishes. It might be sitting in a coffee shop and eavesdropping on conversations or finding the quietest place you can and shutting out the world.
Do what helps you write. Do what helps you write more. Do what helps you write better. Do what works for you.