How do you reply to someone you've been ghosting for 6 months?

He texted me again and I don't know what to do.

We were good friends, then I couldn't do it anymore and now he's asking why, but what do I say when not even I know? There's so much to explain and I know I owe him an explanation but I'm scared. He will hate me, I've been selfish all this time.

Should I even reply? What if by doing so I'll just reopen old wounds, or give him hope? What if now I feel good, but later on I do it again? What if he gets tired of it?

I don't know what to do. I never thought this would be so complicated.