He that turneth away his ear from hearing the law, even his prayers should be abomination – Proverbs 28:9
Abomination is something that is disliked very much by God. He doesn’t dislike the person, but He dislikes the intentions of their heart. God doesn’t listen to our prayers if we intend to go back to our sin as soon as we get off our knees.
If we want to forsake our sin and follow Him, He willingly listens no matter how bad our sin is or has been. What closes His ears is not the depth of our sin, but our secret intention to do it again as though He doesn’t know our heart as well as our thoughts. God is our Father. Just as an earthly parent rejects the apology of their children when they know as soon as they get a chance they will do it again; our Heavenly Father does the same thing. God is a forgiving god. If we willingly sin and have no intentions of forsaking our sin, that’s when God turns a deaf ear to our prayers.