In Matthew 7:21 Jesus said, "Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven." The complaint that Jesus has against those who too late will seek to enter Heaven is that with their mouths they have honored the Lord, saying, "Lord, Lord," but such people have never done the will of the Father. Of course, this Scripture does not mean that only those who have perfectly done the will of the Father in all things are saved. That would mean that only those could be saved who were sinless and perfect. That would make of no effect the blood of Christ. That would be salvation by man, and not by God; salvation by works and not by God's grace. No, Jesus meant that those are saved who do the will of God concerning Christ and salvation - that is, those who trust Jesus Christ as the Lamb of God who died for our sins and so depend upon Him for forgiveness and salvation.
What works are pleasing to God? That question came up and was very clearly answered by our Saviour in John 6:28, 29:
"Then said they unto him, What shall we do, that we might work the works of God ? Jesus answered and said unto them, This is the work of God, that ye believe on him whom he hath sent."
There it is! "This is the work of God, that ye believe on him whom he hath sent"! Not those who do good works, who join churches, who pray, who tithe, who preach; no, no, those are not the will of God as a plan of salvation. The way to work the works of God is to believe on the Saviour that He has sent. The only way one can be saved is to trust the matter wholly with Jesus Christ. It is not prophesying, not casting out devils, not doing many wonderful works that opens the door of Heaven. It is trusting in Jesus Christ, who came into the world to die for sinners. That is God's plan of salvation. One who depends upon Christ and receives Him as Saviour thus does the will of the Father. It is God's will that all should believe on His Son and receive everlasting life. Those who expect to be saved any other way do not do the will of the Father.