Rom 6:4 Therefore we were buried with Him through baptism into death, that just as Christ was raised from the dead by the glory of the Father, even so we also should walk in newness of life.The "baptism" above isn't water baptism, but it's a death and burial of our old sinful nature - the spiritual person we were in Adam. It's now dead and gone, and we've been raised together with Christ into new life! The natural result of growing and maturing in who we now are in this new life is a life of goodness. And the growing process is lifelong. It's by no means instantaneous.
This new life - which is nothing less (or more) than the very life of Christ in us - is where holiness and goodness and righteousness and good works flow from. This new life - Christ-in-me - is the foundation of the Christian life.