Why pain?

Why does pain and hurt exist. I can handle it physically but emotionally it kills me