I think my answer to the question "How to become a realist and stop living in a world of illusions?" will to some extent be the answer to your question.
TheQuestion: we will find those who will answer your questions.
Answering your question more specifically, we can say that criticality and independence of thinking develop from a) work on oneself (gaining self-confidence, respect for oneself and people) and b) education, acquaintance with objective laws and principles of the world order.
From interaction with the world around us. The main tool that promoted and contributes to human survival is his ability to establish causal relationships and recognize patterns. Over time, humanity has even developed a mechanism that excludes our prerequisites for mistakes and allows us to receive information of an objective nature - science.