The Lord does not wait for us to be sinless to answer our prayers, but we should never take that as a license to do what we please. God does not take persistent sin lightly, and we are the most arrogant of people if we expect that He will answer our prayers when we are engaged in such things. If we are feeling powerless spiritually and the Lord does not seem to be responding to us, it might be due to our lack of repentance.
Our good works do not get us into the kingdom of God, but they do evidence the authenticity of our faith. We cannot rely in any way whatsoever on these works if we want to see God, but if we do not have good works, we do not have the trust in Christ alone that justifies us and therefore lays hold of eternal life. We must distinguish faith and good works, but we must not separate them. Faith always and necessarily gives birth to good works of gratitude.