How do you get over your first love?

This is why I'm afraid to fall in love again because shit like this hurts Soo much :( when you give your all to a person and at the end they tell you they don't feel the same anymore and they move on and you .. well you just end up alone and with a heart broken .. x