Firstly, Fertility clinics or doctors and staff dealing with fertility are usually very blase about this as it is something they deal with every day. For the man, however, it can be a daunting prospect. But he need not worry, he is shown to a private room and left totally alone (sometimes with stimulating magazines as an aid). His job is to ejaculate into the specimen container which is then handed in. Very simple.
Some men cannot bear the idea of sharing something so private - therefore they can produce a semen specimen at home provided they can get it to the lab within 20 minutes (which may not be easy in morning traffic!).
Yet other men don't have any hang-ups about this procedure and quite happily donate semen at sperm banks for payment (there is a limit to how many times they can donate, though.
Trust this answers your question.