Hello!
You can do it directly on the minion or from the server. If you are on the salt server, you can do something like the docs mention: "salt <target> saltutil.kill_job <job id>".
Doing it before entering the queue or being executed might be tricky, depending on your scenario.
Salt is built to be extremely fast with ZeroMQ (as mentioned in these docs:
https://docs.saltproject.io/en/latest/topics/development/topology.html, and many others). If you have a very intense salt server, it might take longer to process, but it would still be fast. Or if your execution is too long, you could cancel the rest of the process at least.
In case you are executing direct module calls, this would be harder to predict and also cancel due to the fast execution most of the time.
I hope it helps.
Cheers!
PS: There are some projects like SaltGUI, https://github.com/erwindon/SaltGUI, that might help you do this from a UI level, potentially doing it faster than usual (because finding the job ID can be tricky depending on the scenario). If you are already dealing with REST API, it won't be that hard to make it work on your side.