Sleep, exercise, a balanced diet of mostly whole fruits and vegetables, and a moderate amount of whole grains, legumes and fresh meat/fish/eggs if you're not choosing a vegan lifestyle. Avoid ultra processed foods, cured meats, alcohol and other recreational drugs. Make sure you get enough vitamin D, which can be hard with certain diets if you're not supplementing, or getting the right amount of sunlight(latitude and time of year matters).
Try to stay low stress, spend time out in nature, maintain good relationships, etc.
Edit: caveat to spending time out in nature: be vigilant of ticks. A tick-bourne disease can mess up your immune system pretty well