In John 7:17–18, Jesus sets forth proper criteria for judging the true religion. The first is that in order to judge properly, one must desire to do the will of God. In other words, one must be ready to follow the commands of God wherever they lead and in spite of the fact that they may conflict with our own desires. The second criterion is that the true religion gives all glory to God, “He who seeks the glory of the One who sent Him is true . . .”
In one sense, we must examine every teaching to see if it is from God. However, there is a sort of shortcut here by seeking that religion which most glorifies God. This is what Herman Witsius said in his book The Practice of True Christianity. Here is a portion of that work which deals with this question:
10. But since the nations that bear the name of Christian are divided into so many different sects, what should someone who is concerned about his salvation do? He should not be too surprised or be shaken in his faith since he knows that the corrupted reason of man is inclined towards novelty and will worship and that the devil is always trying to forge false doctrines and introduce them among men. But it is necessary for a Christian to examine all these things and test them by the standard of Scripture. He must receive all that is in accord with Scripture and reject all that is opposed to it.
11. But that is a dizzying and hard work and which not all who seek their salvation are capable of doing. Can’t you show me some shorter and more general way to discern the true Christian religion from those that falsely bear the name? In all the doctrines that have a direct connection with salvation, God gives all His spiritual children such strong sense that they can easily distinguish a saving remedy from poison. Thus, it is impossible that they would be seduced. But to say something more precise and instructive, it is only necessary among all the pretended Christian religions to recognize that which has the following four qualities.
The first quality is that it gives God the most glory and recognizes the best that God is the first and sovereign cause of all good, for it is necessary to recognize as divine that which observes and advances the glory of God the best. That is the language of Canaan. It is its Shibboleth. That’s the voice of the true church, “Not unto us, not us, but unto Your Name, give glory” (Ps. 15:1).
The second quality is that it humbles man most profoundly, abases him, makes him smallest before God, and makes him recognize his inability, misery, and nothingness. For that’s how the doctrine of Saint Paul made man known that he was nothing (Gal. 6:3). However humbled one may be, he can never be humbled too much for Jesus Christ.
The third quality is that it brings man most powerfully to godliness and makes him the most capable of it, for the doctrine of the truth is a doctrine that leads to godliness (1 Tim. 6:3, Tit. 1:1).
The fourth quality is that it consoles most efficaciously the beaten down sinner and that it is able to calm the conscience. For that’s a unique property of the true doctrine of the Gospel: “Comfort, comfort My people,” says the Lord (Is. 40:1).
All these things joined together are an assured proof of the truth of the true religion. And to the degree that a doctrine is more or less conducive to these qualities, it participates more or less in the truth.
Read more here.