So maybe I’m having trouble understanding what temporal punishment is. It is punishment that we will have to endure in purgatory for the amount of expiation we didn’t do here, right?
This is true as far as purgatory goes. Punishment considered in itself is a consequence or effect of every sin we commit. We have broken God’s law and so to restore order in justice punishment or a penalty is inflicted. The penalty that accrues to sin is to satisfy or atone for the fault committed and this is medicinal punishment. If a person steals $500 from another person, than in justice the thief is punished in some way such as imprisonment until he/she returns $500 back to the owner or something equal to $500 to restore a measure of equality. The temporal punishment in relation to sin which is what we are talking about here is a penalty or debt that accrues to every sin that has or can have the effect of atoning or satisfying for the fault or sin committed, to restore order or some measure of justice and equality between the offended and the offender. And, again, this is medicinal punishment.
Or is temporal punishment an attachment that we get from committing a sin. Ex: A person often overeats and now they have an attachment to food.
This is a form of punishment in a certain sense but it doesn’t have atoning or satisfactory value, i.e., it is not medicinal punishment for the improvement or health of the person but makes the person worse and sicker. I mean we can’t atone for overeating by overeating some more or we can’t atone for stealing by stealing some more. I think fasting from food would be a way of atoning for overeating. Just as we can develop habits of virtue so we can develop habits of vice. For example, addiction to porn is a bad habit. Acts of sin can breed more acts of sin and this is a kind of punishment in a way but this is not the kind of punishment or penalty we are referring to when speaking of indulgences, for example, or atoning and satisfying punishment which is medicinal. For example, Adam and Eve incurred as punishments for their sin death of the body and suffering such as weariness in work, child labor, hunger and thirst, sickness, and such like. These are medicinal penalties from God that we cannot help to have so that if we accept and suffer them from God with the right intention and in atonement for our sins than these sufferings are meritorious as satisfying for our sins.