Keep yourself occupied with education, part-time work, volunteer work, anything. Do things that'll prevent you from brooding. Worst thing you can do now is think about it when it's still so fresh in your mind.
Give yourself some time alone to get reacquainted with being single, and when you're ready, you'll know and be able to come to terms with the end of your relationship.