A nice question indeed. So our sages in the ancient times determined the basis upon which the truth value of an idea can be ascertained. Irrespective of where the idea has originated, by validating it against different kinds of proofs, it can be made sure whether the teaching is correct or false. The different kinds of proofs are:
- pratakṣa pramān (Direct Perception) We know something to be true when we directly witness it through our senses. For example, you
know the existence of monkeys to be true because you have seen them
for yourself.
- anumāna pramān (Inference ) You know something to be true by intelligent guessing or inferring. For example, by seeing smoke on the
mountain you become sure of the fire underneath.
- śabda pramān (Verbal Testimony ) You accept something as true when a reputed or reliable person has said it or when it has come from
a reliable source. For example, you know electrons exist even though
you have not seen them for yourself. You accept the words and
testimonies of the scientists for this.
- upamana pramāṇa (Comparison) Sometimes you gain the knowledge of something by comparing it with something else that you know as
true. For example, you might not have seen a bulldog before, but when
you see it for the first time, by comparing its behavior, appearance
and nature to other animals you have seen, you come to the conclusion
that its must be another variety of dog.
- arthapati (Presumption) Sometimes you have to presume something to be true because you know something else related to it as
true. For example, you know your friend exists and know his address.
But when you go to his house you find he is not there. It doesn’t mean
that he doesn’t exist, as you are sure of his existence from before.
So you presume that he is out somewhere. So the statement that your
friend is out somewhere is accepted as true.
- anupalabdhi (Non cognition) You know something to be true when you don’t see it or find it. For example, you know horses don’t
have horns because you don’t find it on any. This proof is similar to
direct sense proof but negatively.
Using one or many of these types of proofs, different schools of thought originated and refuted. For example, the hedonistic Charvak school of thought only relied upon direct sense perception. But direct sense perception can not be always true (e.g. earth looks flat, but its actually round). So by using the other methods of proof (inference, scriptural testimony, etc.) Charvak philosophies were refuted by our acharyas.
Apart from these, the Nyaya school of thought gives 5 steps to validate a teaching or proposition. They are: pratinja, hetu, udaharana, upanaya, nigamana. Please, see this on wikipedia for an example.