1 Corinthians 3:11-15 (NKJV)
For no other foundation can anyone lay than that which is laid, which is Jesus Christ. Now if anyone builds on this foundation with gold, silver, precious stones, wood, hay, straw, each one's work will become clear; for the Day will declare it, because it will be revealed by fire; and the fire will test each one's work, of what sort it is. If anyone's work which he has built on it endures, he will receive a reward. If anyone's work is burned, he will suffer loss; but he himself will be saved, yet so as through fire.
A Christian who understands God's grace will emphasize that salvation is not earned nor can it be deserved. Heaven is the free gift of God. However, the deeper truth is that there are rewards in heaven received on the basis of merit. So while a lost person cannot work for salvation, the saved person works for a reward. This verse goes on to describe the fate of a person whose work is described as wood, hay and stubble. Their work is tested and will not survive the purifying fire. They will enter heaven saved from hell, but empty handed. The foundation is what matters to salvation and that is Jesus Christ. The building on top can only begin once the foundation is laid.
How does your work become gold, silver and precious stones which will survive the purifying fire? Obedience to His commands.
John 14:21 (NKJV)
He who has My commandments and keeps them, it is he who loves Me. And he who loves Me will be loved by My Father, and I will love him and manifest Myself to him."