With God, it's not enough to believe what He says; God wants us to obey what He says.
God gave His people Commandments, but it wasn't enough for the people to believe the Commandments that they were the right thing to do. God expected the people to obey His Commandments.
In the New Testament, Jesus told His disciples to go into all the world and to preach the gospel. He then said, "He that believeth and is baptized shall be saved..."
Jesus didn't say he that believeth is saved; Jesus said he that believeth AND is baptized shall be saved. It is not enough that we believe the gospel, although that is necessary. We must also obey the gospel in order to be saved.
On the day of Pentecost, after Peter preached to the people the gospel that Jesus died for our sins, that He was buried, and on the third day He rose again, they asked, What shall we do? Peter then told them how to obey the gospel.
Acts 2:37-38 Now when they heard this, they were pricked in their heart, and said unto Peter and to the rest of the apostles, Men and brethren, what shall we do?
Then Peter said unto them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and ye shall receive the gift of the Holy Ghost.
They heard the gospel, they heard how to obey the gospel, and then they obeyed the gospel.
Acts 2:41 "Then they that gladly received his word were baptized..."
Paul preached in 1Corinthians 15:3-4 what the gospel is.
1Corinthians 15:3-4 For I delivered unto you first of all that which I also received, how that Christ died for our sins according to the scriptures; And that he was buried, and that he rose again the third day according to the scriptures:
When Paul preached the gospel to them, they received the gospel, they stood in the gospel, and they were saved by the gospel... unless they believed in vain.
1Corinthians 15:1-2 Moreover, brethren, I declare unto you the gospel which I preached unto you, which also ye have received, and wherein ye stand; By which also ye are saved, if ye keep in memory what I preached unto you, unless ye have believed in vain.
"In vain" means "without success or effort...without effect."
Thus, to believe in vain means to believe without effect. For example, if a person believes the gospel but they don't obey the gospel, they have believed in vain.
The gospel preached is successful when people not only believe it but they obey it by repenting of their sins, by being baptized in the name of Jesus for the remission/ forgiveness of their sins and by receiving the gift of the HolyGhost. We aren't saved if we don't obey the gospel. It is in vain if we believe the gospel, and then we don't obey it.
"For the time is come that judgment must begin at the house of God: and if it first begin at us, what shall the end be of them that obey not the gospel of God?" - 1 Peter 4:17 KJV