I used to take a lot of vicodin and that would REDUCE my abitlty to maintain or get an erection... I didn't stop taking the vicodin but starting making MACA and Horny Goat Milkshakes and my erections and sex drive was outta control, my girl put me on a break... hahaha!
Are you taking any medications? How old are you? Discuss with your wife/girlfriend/partner and perhaps she can assist in stimulating you before continuing..or as Turtle21 says perhaps you have some sort of ED and your doctor can help...there are meds out there that certainly do help one maintain an erection in most cases.
Good luck
Jim
this is definitely not something I have any knowledge in, however, perhaps your getting distracted, maybe thinking about work, or other issues. Stay in the game, keep you mind focused on sex and your girlfriend/wife. Kiss her, look at her, touch her. If you can't focus then you should speak with her about it, and tell her maybe she can help you stay focused.
You may also have some sort of ED (erectile disfunction) so if it persists, you should speak with your doctor.
Always make sure to empty your bladder when you have to urinate, never hold it in, this can cause problems with getting an erection, becoming aroused, and maintaining an erection.
Good luck