Try to imagine the relationship that just passed is something very small in your life, a stepping stone if you like, and now you're at the next step of your life. You have all the future to look forward to and not to sound too cliched, there's plenty more fish in the sea

Additionally ask yourself what you will get or are hoping to get out of studying for your classes. Future/career/interest/helping people, if you have a goal it is much easier.