Hi there...erectile dysfunction could be due to many reasons. Anxiety being the most. So first try relaxation techniques and distraction method. Then try to cut down on any habits like alcohol, smoking or drugs. This will help. If there's no improvement then you must be investigated for any comorbidities like
diabetes hypertension hypercholestrolemia. Treating these comorbidities also help. Consult psychiatrist.