I often shared posts on how bacterias helping to protect body from bacterial infections like ear infection and pneumonia. I also said many times that, it is all mental!

No. Sicknesses are not just limited to mind. Some of them sprout in Karma basin. The Khichdi of all past karma. You try N-attempts to remain cool, eat super quality food, live in best controlled environment, and still, there are chances that you will be afflicted by the sickness of some sort.

Past Karma plays role here. And there is solution too. Ayurveda prescribes it. Other medical systems are not mature enough for it.

जन्मान्तरकृतं पापं व्याधिरूपेण बाधते

अर्थात पूर्व जन्मों मे किये गए .पाप कर्म इस जन्म में रोगों के रूप में पीड़ा पहुँचाते हैं.उन रोगों की शांति औषधियों से ,दानादि से ईश्वर नाम स्मरण से,और देवताओं की पूजा अर्चना से हो सकती है.


कर्मप्रकोपेण कदाबिदेके दोषप्रकौपेण भवन्ति चान्ये ।
तथापरे प्राणिषु, कर्मदोषप्रकौपजा: कायमनोविकारा: ||

Sickness event happens because of past karma or derangement of dosha or due to both.

So, along with दवा; जप, हवन, देव-अर्चना is must for living life in a state when you can perform your different dharma-based actions.