When your heart is beating really fast, you can say that it's "racing".
Your heart can race when you're scared, nervous, excited, or when you have some kind of medical problem.
One other thing that can "race" in this way is your mind:
As soon as he said he needed to talk to me, my mind started racing, wondering what it could be about.
This means to think quickly and nervously.