Yes, lack of sleep can affect your immune system. Studies indicate that people who don't get enough sleep or get disturbed sleep are more prone to illnesses after being exposed to infectious viruses and bacteria. Lack of sleep can also affect how fast you recover from sickness.