In Romans 4:16 Paul tells us why we're saved by faith, "in order that it may be in accordance with grace". When we receive salvation by faith, we're thus saying "I trust you to accomplish it God", and according to Paul, this makes your salvation entirely by His grace. This is why faith nullifies boasting (Rom. 3:27). Because if you transfer responsibility to God for your salvation (i.e. faith in Him) then you cannot boast about anything contributing to your salvation. Bragging of self-sufficiency stops when responsibility is transferred.

 

But boasting in the Lord should replace it especially in contrast to what He's accomplished (1 Cor. 1:30-31). When you look at your sin, do not wallow over it's greatness, but instead think about how mighty God's grace is that no matter how bad you are, having took responsibility for your salvation, He is far more powerful and the power of His grace is unmatched by your sin (Rom. 5:20). Look at your sin and say to yourself "wow, my God is mighty to save!" (Isa. 63:1, Zeph. 3:17). Never doubt the sufficiency of God's grace (2 Cor. 12:9), but rather revel in it. Truly we can look to the heavens at any time and say "God look, look at my sins which are many, and yet they don't hold a candle to You!" (Rom. 8:33).