Solution:
It’s important to clarify: You will never be able to create a plugin that cannot be cracked in one way or the other. This is, unfortunately, part of WordPress being open-source and thus accessible and extendable by basically anyone who wishes to.
However, there are methods to make it harder for users to get hold of the premium version for free. Most developers create a free version that is hosted on WordPress.org’s public repository and contains a link, banner, or any other information that lets users upgrade to the pro version.
The pro version, then, is usually either an extension to the free plugin, which means the user must activate both the free and the pro plugin, or a license somehow protects the pro version. Licensing plugins is relatively unsafe, though. You only need one user who’s willing to share a licensed version of a plugin, and it’s easy to remove the license check within the plugin files.
Not to mention that most nulled plugins and themes contain malware and can be a huge security risk for your site.
Most, if not all, of the popular plugins you see on the internet already exist as a cracked (the correct term here is nulled, which you should avoid) version. Long story short: You will never be able to 100% avoid users from “stealing” or “nulling” the pro version of your plugin.
You can try encrypting certain parts that are crucial to the licensing mechanism, e.g., using Base64 to MD5 hashes to encrypt serial numbers or hide the relevant check mechanisms in an obscure part of your code. However, it’ll only be a better of time until someone will figure out how to null it.
I’m sorry for the bad news, but this is how it is.
Here is some more information on how to beef-up your WordPress security when it comes to development. Also, please refer to the official handbook; it has a lot of useful information.