How do I make peace myself?

After went through excruciating pain in my nipples while breastfeeding. I stopped doing it. I was pumping until last week with every two-three hours while my little baby cries out and I have to stop pumping to pamper him and even pumping was painful. I wasn’t able to take care of my lo. I wasn’t able to bond with him. I go back to sleep by July and always worried about my supply, pumping and guilty giving formula.I didn’t want to feed him formula. But now he’s mostly on formula. But, now I’m able to play with him bond with him. I feel relaxed. But somewhere in the heart it’s still bugging me.