There’s nothing wrong with rebounding, as long as you recognize that’s what you’re doing. Have a fling, just try not to break any hearts. Let them know you’re just having fun and aren’t ready for something serious.
But to your first question, distract yourself with as many interesting things as you can. People, games, movies, sports, work, hobbies. Find the next exciting thing. Basically, continue thriving after the adversity of rejection.