How do you stay strong and do the right thing and work on yourself and DB when your heart is in a million pieces?

I understand the logic of this whole process but it's really hard to think clearly when I am so heartbroken. Any tips?