Five Lectures on Psychoanalysis

We see that human beings fall ill when, as a result of external obstacles or of an internal lack of adaptation, the satisfaction of their erotic needs in reality is frustrated.

We see that they then take flight into
illness in order that by its help they may find a satisfaction to take the place of what has been frustrated.

We recognize that the pathological symptoms constitute a portion of the subject's sexual activity or even the whole of his sexual life, and we find that the withdrawal from reality is the main purpose of the illness but also the main damage caused by it.

Freud, Five Lectures on Psychoanalysis, 5th Lecture

Freud's Five Lectures on Psychoanalysis were given during his only trip to the US, in 1909 at Clark University in Massechusetts. There's a short write up on his visit.