In the UI, you can add a friend by clicking the friend tab at the bottom right of the UI
At the bottom of the pop up in the search bar you can search by a friends name or customer ID.
Once you locate the friend, click their name and you can then send a friend request.
On the members.iRacing.com site
1. Locate the "Driver Lookup” bar on the main navigation bar.
2. Type the name of the driver you want to add as a friend, and click the magnifying glass.
3. Place your mouse pointer over the helmet of the driver you want to add as a friend. A popup menu will appear.
4. On the popup menu choose "Send Friend Request”
5. Once that driver accepts your friend request, you will then be connected.
If you hover your mouse over Account and choose myRacers:
you can then see any Incoming Friend Requests and any Outgoing pending Friend Requests: