Needing advice

So my boyfriend and I have been together for almost 4 years. To sum it all up, we were in a hard place talking and on a break and I was very reliant on my guy friend of 5 years to help me through this. My guy friend was trying to help me out of the relationship and basically just making sure I knew that his family would welcome me and I could stay in his bedroom since he’s away for internships, college, etc. and his mom loves me. This is the same guy friend I had a crush on 5 years ago and who had a crush on me at the same time, we just never told each other and I started dating my boyfriend so it never came up, until one night a few months ago I messaged him even though he had a girlfriend and told him I’ve had feelings for him off and on the entirety of our friendship. He told me he really wanted to be with his girlfriend and that was it. I took him off of all social media and haven’t talked to him since but I miss the friendship so much.

Would it be okay to text him and apologize or should I just keep this to myself?