Is there a way to run an initialization function?

Could you give an example of how i’d use this in my case please?