There is no best answer, nor a universal answer.
There are usually ways you can protect against a specific attack, but you cannot protect against them all.
Said differently, putting up one board does not build a fence. You can add more and more boards to the fence until it guards the thing, only to have someone dig under the fence. After hardening the ground you can find someone jumping over the fence. Install a roof and people can burn holes in the fence, or otherwise find ways through the defenses. Fighting on the defensive side of security is about mitigating damage, because attackers will nearly always find another attack vector.
Adding defenses adds costs and burdens. All those defenses cost money to create and use. For software, the more protections you add the more burdensome it becomes to paying customers.
That said, if you are paying online and if your validation service is available 24/7, you can validate through an online service that the user has paid. A minimal system can verify it during install or on first use, assuming your payment server is running. More advanced systems will validate every few times the user runs the software, but even that can be spoofed by an attacker, and paying customers will need access even if they cannot reach the server for some reason.
Finding a good approach to security is an ever-changing balancing act, with constantly-changing business directions.