How To get erect?

A man can get erect in many different ways: masturbating, sexual intercourse, or sexual excitement.