The term “act of perfect contrition” can be a misleading term, because it doesn’t involve an actual act. What it means is that you you are truly sorry for your sin because you have offended God, not just because you are afraid of hell.
The way it works is this. When you commit a mortal sin, you need to go to confession and receive absolution. Now say that you had no way of getting to confession (like you were stranded in the Sahara, or you died before you could get there or whatever). In this case, if you are truly sorry because you offended God, then God will not hold it against you that you were not able to make it to a priest. However, if you are only sorry because you fear hell, that is not enough. This is called imperfect contrition. Now it is very important to realize that you can be afraid of hell and have perfect condition. Just because you are afraid of hell it doesn’t mean you don’t have perfect contrition. What imprefect contrition means is that you are only afraid of hell but not sorry for offending God. In other words, you can be both sorry because you offended God and because you are afraid of hell.
The one other point to remember is that even if you have perfect contrition you must go to confession if you can. If you have all the oppurtunity in the world to go to confession but don’t just because you feel you have perfect contrition, that is another mortal sin in and of itself.