The stress of having a serious medical illness or condition, like HIV, may also negatively affect a person’s mental health. HIV infection and related opportunistic infections can affect the brain and the rest of the nervous system. This may lead to changes in how a person thinks and behaves. In addition, some medicines used to treat HIV may have side effects that affect a person’s mental health.