The punishment for using a VPN illegally depends on where you are. In countries where VPNs are restricted or banned, penalties can range from fines to imprisonment. The severity of the punishment may vary depending on what you were using the VPN for.
In countries where VPNs are legal, you’ll only get into trouble with the law if you use a VPN to engage in illegal activities — in which case, the legal repercussions will depend on the jurisdiction and the nature of the offense.