Suppose someone buys a used car for cash, and the seller says "I will write in the title that it's a gift to avoid sales tax, instead of giving you a discount". Suppose further that the buyer didn't know this would be a tax fraud and accepts the seller's suggestion and gets the car's title. Later the buyer learns the law and wants to clear his record. How can he pay the tax to avoid being known as a person who commits tax fraud?
When the buyer hears "to avoid sales tax" and hears the seller describing as a gift something that s/he knows was nothing of the sort, a reasonable buyer would know that this was at best suspicious, and would find out if this was legal.
But assuming that the buyer accepted the seller's suggestion ignorantly and in good faith, the buyer can file a report of the transaction and pay any tax that should have been paid. The exact way of doing this will vary based on the laws of the buyer's jurisdiction (state-level if in the US) which is not given in the question.
Such a report and payment might not prevent the local tax authorities from assessing an additional penalty. Criminal charges seem unlikely, but would be possible. If the seller was a used car dealer, the authorities might want the buyer to testify against the seller.
They buyer might be wise to consult a lawyer with expertise in sales tax issues in the buyer's jurisdiction. Such a lawyer could advise on exactly what the buyer's legal obligation was, and how to avoid or minimize penalties or other consequences.