I understand why you are frustrated. Give yourself credit for wanting to respond to your friends’ feedback even though it was probably difficult to hear.
I suggest a couple of things: First, do check with other friends to see if they agree that you sound patronizing. It’s just possible that the two friends who talked to you are particularly sensitive to tone of voice and that others don’t agree.
If most of your friends and family generally agree that you do sound condescending, choose someone you especially trust and ask them to imitate what they hear when you speak to them so you can better understand what they are talking about. Then role play different ways to say the same thing until you both agree that you have found a correction. Practice will bring how you speak in line with what you intend to say.
I wish you well.