You sound very young so I'll answer as if I was talking to my younger self,who was in the same situation (multiple times.) The answer to your question is simply "time." How much time is in large part up to you. My advice is to cut contact with this person, or at the worst, keep contact extremely minimal (if possible.) This guy sounds like your typical clown. Probably best to just forget about him, really. Next, take a few months and just chill. Play some video games or watch movies. Reach out to some friends you haven't seen in a while. Or reach out to friends you see a lot. Get exercise. Just kick back and kinda exist for a while. Then think about getting back into the dating game. Maybe see if there's someone single you see often that interests you. Or do phone app dating or whatever.
My point is you're literally going to be fine and there is no reason to believe otherwise. Later in life you literally will not give a single fucking shit about this person or this time in your life. It will be a distant memory. And it will also serve as a learning experience for you, to take to future relationships. Experience like this is HUGE. Most people date multiple people seriously before finding their spouse or long term partner. All those people dealt with the same thing you are.