Use the option from the Community menu, or simply press the ‘C’ key.
Enter the name of the player you want to add to your friend list on the ‘Friends’ tab, and hit the ‘Enter’ key.
To ignore a player, simply select the ‘Ignored’ tab, and enter the player’s name. You will no longer be able to see any messages from them until you remove them from the list.