When a person feels bad his immunity usually goes lower and as a result he can get sick. On the other hand when a person experiences a good mood his immunity goes up and his chance of getting sick is lowered.
If a person hates his job but can't do anything about it then his mind might let him get sick often , by lowering the immunity, so that it gives him an excuse not to go to work. By doing so the mind thinks that its helping (See also how people lie to themselves).
If a person feels intense guilt then his mind might make him sick in order to punish him for what he did. In such a case the mind believes that sickness is better than guilt.
A person who has a low self esteem and who is too afraid to meet people might develop Agoraphobia or the fear of open places. By doing so the mind insures that this person will stay away from people.
A person who badly wants to die might get his wish granted by his mind. The mind can lower the immunity to a great extent or it can even let the person's foot slip while walking on a pavement with the goal of killing him.
When the mind believes that a person is being ignored it might make him sick to capture the attention of the people who ignore him. If a man always ignores his wife and hangs out with his friends then her mind might make her sick to get his attention.
The subconscious mind of a person might make him sick to help him punish someone who treats him badly. A teen who is abused by his parents might get sick for that reason.
If a person is so hard on himself and if he feels guilty when he takes a day off then his mind might make him sick to help him rest for few days or two without feeling guilty.
If a person experienced a tremendous amount of anger or resentment over a prolonged period of time then this anger might turn into depression. Anger is an energy, if it wasn't channeled out in a healthy way then it can turn into depression.
So many people get sick after they lose loved ones. Some people even get so sick that they die. Sometimes the mind brings sickness to help the person go after the one they lost.
Each mood chance a person experiences is reflected directly in the body. When emotions change the stomach movement changes, heart beat changes and the overall operation of the body is affected.