Read: Romans 8-10
Marked: Romans 8:13, For if you live according to the flesh you will die; but if by the Spirit you put to death the deeds of the body, you will live.
The Spirit of God dwells in the believer. But we can still live according to the flesh and indulge in sin if we choose to.
But if we want to live in righteousness then we must put to death the deeds of the body and choose to do what the Spirit wills and learn to walk with Him through His word and apply what it says.