You can start with the Sacrament of Reconciliation if you like, but it isn’t necessary. Purgatory is simply the doctrine that those who are headed for Heaven but are still subject to sin are first cleansed of their remaining sins, and of their tendency to sin, before they enter Heaven.
We know from Scripture that nothing unclean can enter Heaven:
The treasure and wealth of the nations will be brought there, but nothing unclean will enter it, nor any (one) who does abominable things or tells lies.
Rev. 21:26-27 (describing “the holy city, a new Jerusalem,coming down out of heaven from God, prepared as a bride adorned for her husband,” per verses 2-3).
So, if you’re destined for Heaven (a/k/a “if you’ve been saved”) but are still unclean at your death, what will happen? Obviously: you’ll be made clean. That is, you’ll be purged of your sins and your tendency to sin. What do we call the moment of purging you? Purgatory.
The Church does not teach that you can go to Purgatory instead of Heaven. Purgatory is not a “third” destination in the afterlife. All we know is that (A) some people will go to Hell; (B) some people will go straight to Heaven, having died clean (e.g., by dying immediately after Baptism washed them clean); and (C) some people will go to Heaven but will have to be cleansed first. They will then, having been cleansed, enter Heaven. As Paul said, “the person will be saved, but only as through fire.” (1 Cor. 3:15). If the cleansing process is painful (like the removal of an abcessed tooth), so be it; it’ll be good for me in the end.
This does not deny the once-for-all sacrifice of Jesus; rather, Purgatory (that is, the after-death purgation of sin and the tendency to sin from us prior to our entry to Heaven) is made possibly ONLY by Christ’s sacrifice for us.
To put it another way: Jesus died once for all of us, and His singular gift cleanses us all of all of our sins. Purgatory is merely one instance of that cleansing. Baptism is another; Reconciliation is a third.