I would to ask you , on how can create an event (programatically) when I change the external ID in contact form, how can I t make some kind of process like validation in another module or service I know I can create something like a hook but I dont know how to start working with hooks in civiccrm, is there any document, book ,link, video, note where I can learn about it? I would really appreciate this, thank you in advance.
Create an extension
The first step to create a hook is to create an extension. I'd recommend installing civix which can generate an empty extension by simply typing the command :
civix generate:module myextension
Go check https://docs.civicrm.org/dev/en/latest/extensions/ for more details about extensions.
All you need to know for now is that civix will create a file called myextension.php where you can put your hooks. There are a few hooks commented as examples in the generated files.
Create the hook
A hook is simply a function that start with the name of your extension and finish with the name of the hook. For example
hook_civicrm_post will be named
myextension_civicrm_post in the extension we've just created.
In your case, I believe
hook_civicrm_post is the one you want to use but you can see the documentation about the hooks in :