Yes lack of sleep can affect your immune system which can lead to getting sick.
Our bodies need the proper amount of sleep to keep healthy.
I sometimes suffer from Insomnia myself so I can say from experience that not getting enough sleep makes a person feel bad the next day and without the required sleep our minds and bodies don't function correctly and we're not as alert as we should be.
Lack of sleep also causes nausea, headaches, muscle aches and even a stomach ache.
I know when I don't get enough sleep at night my stomach always feels hungry the next day even though I've eaten food.
Sometimes I have to resort to the sleeping pills even though I hate taking them but sometimes I have no choice.
When you're lacking sleep you're more prone to make mistakes, and your reaction time will suffer as well.
You'll also likely get infected with Viruses much quicker than others who got enough sleep since lacking sleep weakens our immune system.