You can do it from local contacts for live things or the history tab in the comms panel.
You can also look people up in the social tab of the main menu send them a friend request and immediately block them from the drop down menu. Then cancel the friend request.
CMDRs who killed you will get marked with a red symbol in the coms panel in the contact history tab - the one with the clock symbol.
To block a CMDR there is no need that they communicated with you. It's enough that they where in the same instance (SC for example).
Every CMDR who you've shared an instance with (regardless of whether they interacted with you, or if you even saw them) will still be in the "Contact History" tab of the comm's HUD, from where you have the option to block them.
Go into the comms menu, you'll see a little clockface its the CMDR history tab. It shows everyone you've been instanced with recently, latest first if they killed you I think its marked.
Purple hair-do's are very popular with gankers (not exclusively).
FYI, if they came with friends, you might want to block those as well. If you block guy-1 and don't block guy-2, guy-3, you may end up in the instance with guys 2 and 3 and of course guy 1 will be there with them.