Depends on how it's broken ... a PHYSICALLY broken heart can only be fixed with surgery. An EMOTIONALLY broken heart ... get a hobby, and stop relying on other people to provide you with happiness or self-worth.
Time mostly. First you are sad. The grief of losing something you thought was going to last hurts. Cry and let it out. Then you get mad. How dare someone treat you like that! Then you get even. Just remember the best revenge is living well. So you go out and do things YOU want to do. Go places YOU want to go. Learn something YOU think would be fun to learn. Before you know it you are a better version of yourself and it is because you are without the person who broke your heart! Now go eat some ice cream and cry and get it out of your system so you can move to the next step.