Read what Martin Luther says about how sins are forgiven in Luther's Works, volume 30.
“Sins are not forgiven because of application to works; they are forgiven when I call upon the name of the Lord Jesus Christ because I believe that He is the expiation for our sins. This is the truth. But the devil does not let us remain on this road. He immediately brings up our works. Therefore let no one cleave to his own works. It is our nature to say: ‘I have sinned with a deed. Therefore I shall make expiation with a deed.’ The devil, who strengthens our error, is present. One must attack this sin with the promise that sins are remitted for His name’s sake, as Ps. 25:11 says” (LW 30:245).