Read this. And then this. And then this, which breaks down advances and royalties and how they work. Here is also an excellent essay by Jeanine Frost on how writers get paid, how much they can expect to get paid, and when to quit your day job.
As for classes, there aren’t any specific ones you have to take. I took some writing classes in college. That’s it. I majored in English, but a lot of writers don’t. Some major in creative writing, psychology, philosophy, or even math. There are no school or educational requirements for becoming a writer, though you can always choose to take classes if you want to. Mostly what I did that was significant was read a great deal. Stephen King in ON WRITING says to read over 70-80 books a year. That’s a book about every four days. Sounds about right.
A more detailed explanation about classes and workshops can be found here.
As for getting paid and making a living writing novels, you might want to read this.