I have often wondered about this.
I lived for several years in a state of mortal sin while I “rebelled” against the Church.
And yet every time I turned around, there was God, especially when I was in the midst of my sin.
The graces are there and by those graces, we continue praying. We do nothing on our own; the Lord calls us and gives us the grace to arise in the morning and the grace to pray whether for ourselves or others. And those prayers are ALWAYS heard.
I heard it somewhere, though, if we carry out a work which would obtain special grace while we are in the state of mortal sin, the grace is witheld until we recieve the sacrament of Confession.
For example: let’s take a firefighter in Louisiana, who maybe committed a mortal sin, couldn’t make it to Confession and is unlikely to do anyting other than help refugees for days. A Extraordinary Minister happens to find this person and offers Communion, which the firefigher accepts. He/she is in mortal sin; yet interiorly they are aware of their sin and know that they need to go to Confession ASAP…but how many days before he/she will even get to Mass? The grace of Communion and the prayers that go with it are still there…yet witheld. When that person in question gets the opportunity, maybe still there at the scene of devastation, finds a priest and Confesses, they recieve not only the grace of forgiveness but the grace from Communion.
Maybe this isn’t the best way to explain it but it helps me, and a similar scenario was used on EWTN as applying to a soldier or someone living in a country where religion is suppressed.
I hope someone else can explain this in a better manner.
Just keep in mind…God can always hear you. Even when we reject him, he does not reject us. When we commit mortal sin, it is our act of turing from God. When we are ready to reconcile or make efforts, he is always ready to listen.