Heart break

My boyfriends after three years said we’re friends. Just friends. He said he needs to time to figure things out and experience things for himself. We got together young. He said he might be back. How do I get over this pain? I love him so much and I’ll keep waiting for him as long as it takes.