On Steam, you can head to the "Add a friend" section to enter your friend’s ID.
If you wish to find a random player you played with and add them as a friend, the same section has a "Recently played with" option featuring the IDs of all those you played with.