Most men loathe having to see the doctor, even more so if it involves sexual functioning. However, you know your sex life is suffering, and of more importance is the fact that erectile dysfunction (ED) can indicate medical problems. Only your doctor has the skills and resources at their disposal to make a proper diagnosis and to treat you effectively.
Men frequently say that they don't know how to go about telling the doctor their problem. Some aren't even sure it is a medical problem and some simply don't know the words to use. What they may also not have realized is that every family doctor will have many patients who suffer with ED. They are used to hearing sexual function described in a whole variety of ways, so you are unlikely to shock them.
So, you've made the decision and you're facing the doctor. Say it straight out along the lines of, "I think I have ED", or, "I can't get an erection", or "I lose my erection", or "I can't get a hard on". Use the language you are comfortable with as it will help both you and the doctor.
The doctor will need to ask you some questions and you need to expect them to be direct and to the point. They will ask for more details about your erection, whether you get erections in bed, whether you can masturbate and so on. You'll be asked about your lifestyle (smoking, drinking, etc) and depending on your answers you be asked to drop your pants to allow the doctor to examine your testicles and penis. This won't be painful. Some doctors may want to examine your prostate and this involves the tip of their finger being inserted into your anus to enable them to check for any swelling or hardening of the prostate gland.
At this point further tests or a treatment may be recommended.