It happens to the best of us. You’ve just learned a person’s name five seconds ago (or, worse, met this person several times before) and now you’re drawing a blank. While there are things you can do to remember names next time, you can get around the current emergency in a few ways.
If you’re at a professional function and you don’t have it already, you can ask for the person’s email address, which might give you exactly what you need. You could ask for their name and pretend you just didn’t know their last name, although that one’s been used so many times that it’s basically an admission of guilt. You could also introduce the person to your friend (“This is my friend Tina,” and Tina can ask the nameless person’s name).
Or, of course, you can just fess up and say you’ve got a terrible memory, but it’s awesome if the other person has remembered yours. Paying them an appropriate and thoughtful compliment after your embarrassment can help mitigate the damage.