Dying with Unconfessed Mortal Sin
If you are sorry for a mortal sin but die before you go to confession, will you go to hell?
Such judgments are up to God, who is perfectly just and merciful. We would presume that someone's desire to go to confession would be something that God would take into account in the judgment of the individual. If someone is unable to get to confession, then perfect contrition can obtain forgiveness of their sins.
The Catechism of the Catholic Church:
When it arises from a love by which God is loved above all else, contrition is called "perfect" (contrition of charity). Such contrition remits venial sins; it also obtains forgiveness of mortal sins if it includes the firm resolution to have recourse to sacramental confession as soon as possible (1452).
The Baltimore Catechism:
Q. 765. What is perfect contrition?
A. Perfect contrition is that which fills us with sorrow and hatred for sin, because it offends God, who is infinitely good in himself and worthy of all love.
Q. 766. When will perfect contrition obtain pardon for mortal sin without the sacrament of penance?
A. Perfect contrition will obtain pardon for mortal sin without the sacrament of penance when we cannot go to confession, but with the perfect contrition we must have the intention of going to confession as soon as possible, if we again have the opportunity.