Well, there are many definitions. Let's stick at "unable to achieve an erection", or "unable to make an erection last until orgasm".

You probably need a combination of things here. The main thing is a lover who is willing to be patient, and even forego full sexual pleasure while helping you. The thing to work with comes from two sexual therapists, Masters and Johnson. Yeah, they always get a mention with droop. But they have a point, and it's worth trying.

Set up a romantic room. Avoid alcohol. Become naked together, and learn to stroke each other all over but not the sexual parts. This takes time. The first few times you aren't going anywhere near genitals. You're going to hug, and stroke, and massage, and talk about what you enjoy. An erection is to be ignored totally. There is no need to even consider an orgasm. It's a time for learning to touch. Learning to love. You need to learn to worship each other.

Gradually you can introduce genital caress. Not with a view to orgasm, nor with a view to sustaining an erection when one starts, but just to re-learn pleasant sensations. Later, assuming this is successful at creating a sustained erection you can aim for orgasm.

Now that was a start. In simple cases it is likely to be all that is needed. But things aren't always simple. One beacon shines out, though. Erect or flaccid, the penis is designed to produce an orgasm. Stroking the glans of a penis which is physically undamaged, and stroking it with care, will produce an orgasm. It takes practice, it takes time, it takes learning the technique, and it works. Great for you, but maybe a bummer for your partner if penetration by you is required.

Lack of erection is likely to have a cause that a doctor can help with. Go and see your doctor. Discuss any drugs, prescription, over the counter, and recreational, that you are using, and the effect they may have. Eliminate anything you can that destroys erections, and work from there.

Several practical and physical things are worth trying.

The Penis Pump is often sold as a penis enlarger. That's a confidence trick. It will enlarge it, sure. But it does it from flaccid to erect. And when the pump is removed, the erection wilts.

The pump needs to be used in conjunction with a Penis Ring. This is an external ring which you place round the bas of the penis, sometimes around the scrotum as well, after you have pumped and before removing the pump. Its job is to "hold" the erection. It works. The erection is sort of artificial, and you must remove the ring before the blood goes "stale" and your penis is damaged irretrievably, but it works. Penetrative sex is back. You can buy this over the counter, but a specialist doctor is better placed to advise you that the toyshop sales assistant.

Anal Stimulation is far easier to talk about if you're gay that if you're straight. Gay men accept anal play and decide for themselves whether they wish for anal intercourse. I'm not talking about anal intercourse, though. I'm talking about devices that stimulate the prostate and the anal sphinctre, and which will stay put during the bucking and rearing of full blow, all out sex.

You need to visit several toyshops, and have the budget for a few assorted toys. Butt Plugs, Anal Plugs. That's the section to look at. Shy? Stuff "shy". This is your happiness we're talking about. Like everything, going through the door for the first time is the hardest part. Once inside it's fascinating! You could use e-shopping, sure, but judging size and potential comfort isn't easy online.

The plug's job is to stay inside you, to be comfortable, to feel erotic, and to stimulate the prostate. The prostate is the "orgasm centre" of your body. Stimulating it is likely to produce an erection. Even if it doesn't, it's going to help you reach orgasm.

Viagra and other prescription medicines are an interesting solution. Do NOT buy it online to "try it out". Consult your doctor, even if you are otherwise healthy. Viagra (etc) is contra-indicated with several physical ailments, some of which are hard for you to detect yourself, and others of which are impossible.

It works. But not for everyone. It depends on the underlying issues, because some of them are not "viagra-able"

Surgery is a potential solution to long term and permanent lack of erection. There are several types of procedure. The two most common are the insertion of implants. The simple type keep the penis erect, but you can bend it up or down at will. It'll make your swimsuit look unusual, though. The second type is inflatable, with the pump mechanism inserted inside the scrotum, and a valve to allow you to deflate it.

Penile Surgery hurts. It hurts a lot. Up to you.

Electrical or Electronic Stimulation is a bit of a facer. For years farmers have used electro-ejaculators on livestock to make it easy to collect semen for artificial insemination programmes. The device is inserted anally, stimulates the animal's prostate, creates an erection, and causes ejaculation. The poor animal is somewhat bewildered, and semen is collected.

Not surprisingly people have used these devices on themselves. But beware. Some of them are "industrial strength", and will be dangerous. I don't fancy inserting one, pressing the switch, and frying my prostate. Do you?

You also have to be aware that electrical devices are associated with torture. Almost all brutal regimes torture men anally and genitally. Why? Because torturers are sadists. And they get off on it. However, if you want information on how to create your own device, and self creation is recommended if you follow the instructions properly, then there are plenty of online resources. Search for "Electrosex". There used to be a club on Excite which went into some detail on it. It may be still there, but Excite has a policy of trashing adult content clubs, especially anything to do with the anus.

You'll have to read all the shit about torture, and see that most of the sites are S&M sites. OK, you can do that. This is legitimate research. In those sites are descriptions of devices which may or may not be useful. With experiment it may even by that you can have an electrode each, and the stimulation starts when sex starts!

DO use care. Electricity is dangerous. It is perfectly possible to kill yourself if you make an error with amperage.

You can also use a TENS machine and its electrodes.

I don't vouch for whether any of these self help this will work for you. They have worked for other people. Your most important resource is your doctor. Just go, and talk about it. It isn't unmanly, nor embarrassing (well it is, a little). It's unlikely to be permanent, so get help.