Now what? I know you want to defend yourself, to clarify that it was a mistake you don't usually make. So, here's a handy primer for when you messed up.
First things first. This is what you say:
"Wow, I screwed up. I'm sorry. Thank you for telling me and I will do better in the future."
And that's it. That's all you say. You stop talking, you don't defend yourself, you don't explain. Just take a break. Once you've calmed down from feeling bad and/or defensive, do some research. Look at the people who are taking the time to educate you.
Start with reading The Invisible Knapsack, especially if someone has said you are coming from a place of privilege. This essay carefully explains what exactly that means.
I've always seen privilege as a river of sewage running through our ideals of equality. People like walking in the middle of all that hate because it's warmer and the current can take you further. If you manage to escape the current and start walking to the beach, you start off feeling colder and slower at first. Then you realize how much better the world smells, and how much more fun you are having with all these neat people.
Of course, we all still slip up or fall into an unseen deep spot. When you apologize and step back, you give yourself to wash off the garbage and see what happened when you are more clear sighted.
(I do know that being able to step back is a privilege in and of itself.)
While you are researching and thinking, try to remember a time when you experienced true equality. I like to think of going to a George Clinton/Parliament concert. Even though I was queasy from all the pot smoke (I'm allergic), I got a glimpse of at what one nation under a groove could do. We all danced together - no self-segregation. Everyone was smiling at each other (the pot might have helped, but the music was what brought us together). I had NEVER seen everyone taking up equal space on the dance floor. This show was a harbinger of hope.
Lastly, when someone says they have experienced racism, the best way to make them feel better is to give them loving human contact. In a real way, they are grieving a lot, especially one of trust. Buy them some croissants (or whatever. You know what they like) and do something nice together.
In the end, the best way to keep combating racism is to be real and honest with each other.