It’s a simple question, but has a complex answer.
First, you might suspect you are not in a state of Grace, but only God knows for sure. It’s possible that it’s a non-issue.
Second, what type of contrition do you have? There are two types:
- perfect contrition - Sorrow for sinning because it offends God.
- imperfect contrition - Sorrow for sinning because of fear of consequences.
Perfect contrition obtains the forgiveness of sins - even mortal sins. You should still seek Sacramental Confession at your earliest (reasonable) opportunity, but if you die beforehand then you are OK.
Aside from that, the Church teaches that a person who dies outside a state of grace is consigned to hell.
However, never underestimate the mercy of God. God may take other things into consideration that are not contained in the Church’s Deposit of Faith. This same reasoning is also why the Church holds hope that unbaptized infants can be admitted into heaven, even though this is not part of the Deposit of Faith.