There is a lot of nice examples of how to create a trigger. This poped up in my first search: https://www.sitepoint.com/how-to-create-mysql-triggers/.
Do not forget to take into account whether order amount can be updated/deleted.
However even though I consider triggers to be great in themselves, I rarely tend to use them. Mostly because it is easy to forget about them. Then you are thoroughly searching your code to find out why is it behaving like it is, just to find out, that the code itself bears no answers. The answer is hidden in the database. Or quite the opposite, you know that the trigger is there and consider it to be a magical black box that does your work for you. Therefore you do not double check on its functionality, which could backfire.
https://stackoverflow.com/a/460343/7081773
Therefore in your place, I would move the logic into the code executing the insertion into orders (unless you are doing everything in the database only). That, of course, will require to create functions for order modification. Those functions will handle stock modifications as well. You would use them instead of direct sql queries. That would provide you better control over the code base.
Or maybe even better, do not modify the stock itself. Subtract the ordered amount when you are reading the remaining stock for the application (maybe create a view for that). Modify the stock amount only when it really changes (like when the product is shipped). That way you know the amount really in stock, how much is ordered and you can always compute how much is available (in stock - ordered = available). Of course you can go the other way around, just as you started to. It will work too. It just seems a bit more logical for my mind, as I usually do it this way...