Being baptized is a ritual that shifts boundaries. It symbolizes dying to self and living a new life in Christ. It is not an isolated event. People are always incorporated into the community of believers by being baptized. That is why families were baptized together in the New Testament. But being baptized alone doesn't save you. There must be a commitment to the Lord Jesus Christ and you must be born again. Then you are baptized.
" For as many of you as were baptized into Christ have put on Christ."- Galatians 3:27 ESV