There's been a lot of answers so far about how to "go to heaven", but I'm hoping maybe I can help offer a different way to think about this.
So here's the thing, what happens after death is unknown. And the Bible doesn't really tell us--it is vague. It's vague because the Bible isn't really interested in telling us about what happens right after we die.
Instead the Bible is interested in the reality that God has, in Jesus, invaded our hurting, broken, fallen world in order to rescue and heal it. His resurrection means our resurrection, which is what we truly hope for--that even as our Lord Jesus was raised from the dead we also will be raised up to eternal life in the world to come. Because God cares about His creation, and is not going to let it all perish; God is going to make all things new, there will be a good and better world, the Scriptures say that a day will come when peace flows like a river, that there will be a time when justice reigns on the earth.
Between death and resurrection not much is known, but we are promised that we will be present with the Lord.
So how. How do we be present with the Lord while we await for the resurrection? How do we know that we'll be part of that good future world? Because that is God's good and gracious work He is doing for you, for the world, for everyone and everything. That's why Jesus came, it's why He died, rose, ascended, and is coming again. Put your trust and hope in Jesus Christ, He is the One who suffered, died, was buried, and is risen from the dead. He is the One who saves. He is the One who heals. He is the One who has overcome and defeated the powers of sin, death, hell, and the devil. Our Lord Jesus has the victory, and in Him there is hope and salvation--put your faith in Him. And if you trust Him, and in Him know that God is indeed the gracious God who is redeeming and saving the world, be a person in this world who can speak of that future world. That there will be a time when justice and peace rule, so now in this world be a person of justice and peace--justice for the hungry, the poor, the downtrodden. Don't look to your works to save you, but look to God's grace to keep you--and in that grace love your neighbor. Your future, in Christ, is secure--you can trust Him in that. But now, here and in this place, be present toward your fellow man with the same love and mercy you have received. Seek to live toward your neighbor as though that future hope is indeed most certainly true.
-CryptoLutheran