Automation snippets? how do you do them?

i would like to know if any of you have any tips regarding making snipets of automation to be reused in same and other projects. What is the best way to do this if possible …
Thank you a lot