That's the opposite of what you need to have an erection. The key here is to relax and let your parasympathetic nervous system take over. Signals that travel along this network will direct the arteries and sinuses of the penis to expand and let more blood flow in. Avoid whole-body stimulants. That means caffeine and certain questionable substances touted as potency enhancers.
Stimulants tend to have an overall effect.
They constrict the smooth muscle that must dilate before an erection can occur. Refocus your attention. One way to relax is to focus with your partner on the more sensual aspects of intimacy. Play with and enjoy each other without worrying about that erection. So don't be led by your penis.