I'm really glad that you have friends who are able to be supportive through this, especially since you're in a situation where you do have to be around him in class sometimes.
I wonder if it would be helpful for to read a few of our articles about abuse in relationships, and about what sexual consent should
look like, to give you an idea of how what he was doing was falling under the umbrella of abusive behavior. I was thinking about these articles in particular: Blinders Off: Getting a Good Look at Abuse and AssaultDriver's Ed for the Sexual Superhighway: Navigating Consent
Also, you ask about how to date or be close to someone again, and I think that's something can take time. One thing you can do is spend some time thinking about how you'd like a future relationship to look, in terms of how you and your partner treat each other, handle conflict, show respect, etc. We have an article all about creating healthy relationships here: Hello, Sailor! How to Build, Board and Navigate a Healthy Relationship
Taking a look at this can help you in choosing what sort of people you want to date in the future, and in identifying what might be healthy or unhealthy in future relationships.
If doing a bunch of reading feels overwhelming right now, that's ok; you can bookmark those for later. It's ok if you want to just take a break from thinking about dating for a bit, while you recover from this previous relationship and lean on your friends a bit for support. Sometimes it can be nice, after a bad relationship, to think about some personal hobby, project, or interest that maybe fell by the wayside during the relationship, and take the time and mental energy you've gotten back to pursue that a bit. It might be a creative hobby, or a sport, or reading some new books...something that's fun for you that maybe you haven't felt like you have time for lately.