Romans 5:1; Ephesians 2:8-9 and Acts 2:38; 22:16; 1 Peter 3:21
Saved by faith
(Romans 5:1) - "Therefore having been justified by faith, we have peace with God through our Lord Jesus Christ."
(Ephesians 2:8-9) - "For by grace you have been saved through faith; and that not of yourselves, it is the gift of God; 9not as a result of works, that no one should boast."
Saved by baptism
(Acts 2:38) - "And Peter said to them, "Repent, and let each of you be baptized in the name of Jesus Christ for the forgiveness of your sins; and you shall receive the gift of the Holy Spirit."
(Acts 22:16) - "And now why do you delay? Arise, and be baptized, and wash away your sins, calling on His name."
(1 Peter 3:21) - "And corresponding to that, baptism now saves you—not the removal of dirt from the flesh, but an appeal to God for a good conscience—through the resurrection of Jesus Christ,"
There is much debate within Christianity as to whether or not baptism is necessary for salvation. I cannot here exhaustively examine this issue, but I can affirm that baptism is not necessary for salvation. The scriptures teach that justification is by faith (Rom. 5:1). It also teaches that baptism is a necessary result of becoming a disciple of Christ (Matt. 28:18-19). Even 1 Peter 3:21 above says that the baptism mentioned is not one dealing with water, but an appeal to God.
God works covenantally. A covenant is a pact or agreement between two or more parties. The New Testament and Old Testaments are New and Old Covenants. The word "testament" comes from the Latin testamentum which means covenant. So, the Bible is a covenant document. If you don't understand covenant you cannot understand, in totality, the issue of baptism because baptism is a covenant sign. Covenant signs do not save. The things they represent are what save.
Regeneration occurs by faith (Rom. 5:1). Afterwards, baptism is administered as an outward representation of an inward reality. For example, it represents the reality of the inward washing of Christ's blood upon the soul. That is why it is used in different ways. It is said to represent the death of the person (Rom. 6:3-5), the union of that person with Christ (Gal. 3:27), the cleansing of that person's sins (Acts 22:16), the identification with the one "baptized into" as when the Israelites were baptized into Moses (1 Cor. 10:2), and being united in one church (1 Cor. 12:13). Also, baptism is one of the signs and seals of the Covenant of Grace that was instituted by Jesus.
Baptism is not a requirement of salvation, but it is so closely tied to it that some people erringly think it is the actual thing that saves. It isn't. Faith in Christ is what saves.