The Bible says we should test the spirits to see if they are of God. How do we test the spirits to determine if it is from God or not?

I would say, if you don't hear God's voice, or you don't have any dreams or visions, or you don't receive any signs, that's a red flag. You WANT God to talk to you and send you dreams and visions and signs. But we also need to compare those things to what is already written in the Bible. God cannot contradict Himself.