Temporal punishments basically deal with sanctification. When you sin you hinder your sanctification (waste the time and gifts God has given you to grow in holiness), thus to “make up for” that sin you must do extra acts of charity motivated by love/fear for God. Check out these verses of Scripture:
Through love and faithfulness sin is atoned for; through the fear of the LORD a man avoids evil.
-Prov 16
8Above all, love each other deeply,
because love covers over a multitude of sins.
-1 Pt 4
19My brothers, if one of you should wander from the truth and someone should bring him back, 20remember this: Whoever turns a sinner from the error of his way will save him from death
and cover over a multitude of sins.
39Then the Lord said to him, "Now then, you Pharisees clean the outside of the cup and dish, but inside you are full of greed and wickedness. 40You foolish people! Did not the one who made the outside make the inside also? 41
But give what is inside the dish to the poor, and everything will be clean for you.
42"Woe to you Pharisees, because you give God a tenth of your mint, rue and all other kinds of garden herbs,
but you neglect justice and the love of God. You should have practiced the latter without leaving the former undone.
-Luke 11
Popular Purgatory passages are 2 Macc 12:46, Matt 5:25f, 1 Cor 3:15.
In remitting temporal punishment two main things are fixed in regards to your soul:
1)Attachment/Urge to a given sin is lessened if not fully eliminated.
2)Repairing of a damage done.