It's tricky, but I always try to figure out what skill they need for each class and have them go sit in on classes or try to work on bringing up that skill somehow. I think that helps in improving them and the grade itself. If they participate in class, like either actively listen or take notes, one of them helps with skill gain or grade gain. I don't remember which one. So I always have my Sim go back and forth between those. Like have it be on one for a little bit and then change it to something else.
Edit: I've found out that having my Sim do 3 or less on classes is a big help. I tried 4 classes once and that was way too hard to keep up with. My Sim I think failed the first time and she was always unhappy because I couldn't concentrate on anything else but homework for her. If you do less classes, I don't know if it helps but there's an option on the computer to have them study more once their homework is done. I don't know if it improves the grade or not. I haven't tested it out much.