My understanding of the purpose of water Baptism.
Now, no stoning nor booing please.
Baptism in itself is important, but not necessarily in a context of going to Heaven. There is some of it there, but only as one of the ways of expressing the faith. There is thief on the cross, so it is not necessary for salvation.
There is also a Lutheran way which I would keep to myself.
Here it is.
Died=separated. OK. We understand that.
RO 6:1 What shall we say, then? Shall we go on sinning so that grace may increase? 2 By no means! We died to sin; how can we live in it any longer? 3 Or don't you know that all of us who were baptized into Christ Jesus were baptized into his death? 4 We were therefore buried with him through baptism into death in order that, just as Christ was raised from the dead through the glory of the Father, we too may live a new life.
RO 6:5 If we have been united with him like this in his death, we will certainly also be united with him in his resurrection. 6 For we know that our old self was crucified with him so that the body of sin might be done away with, that we should no longer be slaves to sin-- 7 because anyone who has died has been freed from sin.
The Romans text presents that dying to sin is being separated from sin.
It is also showing that crucifying our sinful nature is how we are separating ourselves from sin.
Now, crucifying the sinful nature does not mean killing it. People on the crosses hung there for days alive, yet crucified.
Sinful nature may be killed only by Spirit, and that can happen only at the Spirit's timing.
I did a Bible study on that how to have this accomplished.
To make the story short(er)

and to get to the point ...
- We are born with "cords of Hell" attached to us feeding out sinful nature by Hell (ask for verses if you want to know). These cords are connected to eye, hand, foot, heart, tongue.
Yes, just like we see in sci-fi movies - a baby connected to feeding tubes in some futuristic machine dominated world.
2SA 22:6 The cords of the Sheol (hell) coiled around me;
the snares of death confronted me.
JAS 3:6 The tongue also is a fire, a world of evil among the parts of the body. It corrupts the whole person, sets the whole course of his life on fire, and is itself set on fire by hell.
MK 9:43 If your hand causes you to sin, cut it off. It is better for you to enter life maimed than with two hands to go into hell, where the fire never goes out. 45 And if your foot causes you to sin, cut it off. It is better for you to enter life crippled than to have two feet and be thrown into hell. 47 And if your eye causes you to sin, pluck it out. It is better for you to enter the kingdom of God with one eye than to have two eyes and be thrown into hell, 48 where `their worm does not die, and the fire is not quenched.'
- During Baptism we die to sin.
Meaning the Old Self gets separated from us. The cords get severed, clipped. The Old Self is still on us, but like an old shirt. But it is no longer glued to our skin.
RO 6:2 ...We died to sin; how can we live in it any longer? 3 Or don't you know that all of us who were baptized into Christ Jesus were baptized into his death? ...
6 For we know that our old self was crucified with him so that the body of sin might be done away with, that we should no longer be slaves to sin-- 7 because anyone who has died has been freed from sin.