(1) Baptism without faith in Christ accomplishes nothing. We aren't Roman or Eastern Catholic. No faith? No salvation. The ordinances of the Church have no saving power.
(2) Believing in Christ saves you, with or without baptism. John 3:16, that wonderful verse, is clear. Cornelius was saved prior to baptism, because God gave him the Holy Spirit (Acts 10). God doesn't give the Holy Spirit to unsaved men.
(3) Belief in Christ can be expressed to God via baptism, and in that sense Peter said baptism saves you. See 1 Peter 3:21. This perspective was normal in the book of Acts, because they baptized immediately, as part of the conversion experience. Baptism was the person's confession of faith in Christ to God.
All three of these points are important. Point 1 keeps us away from sacramentalism. Neither baptism or the Lord's Supper have any spiritual power in-and-of themselves. Point 2 is the clear teaching of Scripture. The thief on the cross was saved without baptism. We are saved by faith alone.
But point 3 harmonizes verses like 1 Peter 3:21, Acts 2:38, and Acts 22:16 with point 2. Baptism was the outward way that someone called on the name of the Lord, as Ananias said to Paul. Ananias said Paul would wash his sins away by being baptized; but what he meant was Paul would wash his sins away by "calling on the name of the Lord."
Baptism's role in salvation was derived. You could be saved without baptism, like all the saved people in the Old Testament, or the thief on the cross. But baptism became part of your conversion, when you used it to call on Christ to be your Savior.
Baptism was mainly a confession to God, not so much a testimony to others as we think of it today. That's why Philip could meaningfully baptize the Ethiopian eunuch when it was just the two of them by a desert stream (Acts 8:38).