Deuteronomy 5:29 Oh, that they had such a heart in them that they would fear Me and always keep all My commandments, that it might be well with them and with their children forever!
I often used to think that I had to sort myself out and that when I did do that, God would be more willing to take me in; but that is not the case!
God is willing to accept us in whatever state we are in as long as we come to Him in repentance and humility. He then gives us the opportunity to change so that we can be more like Him.
He gives us the chance to keep His commandments and take His Word and keep it in our hearts; that way He has more to work with!