Depression, guilt, worry, stress, and anxiety all contribute to loss of libido and erectile dysfunction. If a man experiences loss of erection, he may worry that it will happen again. This can produce anxiety associated with performance and may lead to chronic problems during sex. If the cycle is inescapable, it can result in impotence.