Purgatory Is Not for Forgiving of Sins
What can I do when I am in purgatory to receive forgiveness for my sins?
There is nothing anyone in purgatory can do either to receive forgiveness for sins or to obtain remission of the temporal punishment due for their sins that is being expiated in purgatory. Forgiveness for sins happens before death. All those who are in purgatory have had their sins forgiven. What happens in purgatory is that they are doing penance for the temporal punishment that was due for the sins they have been forgiven.
Souls in purgatory also cannot do anything to shorten their stay there. That is something that can only be done in this life—either by doing penance for our own sins before our death or by praying for and obtaining indulgences for the souls in purgatory. The reason it is so important for Christians to pray for the souls in purgatory is because they can do nothing to help themselves. For more information, please see my article The Care and Feeding of Poor Souls.