Talk about authorship expectations in your initial consultation on any project. You may need to drive these conversations if the people around you are not doing so.
In some cases, your contributions may not really rise to the level of authorship, but if you are making intellectual contributions like choosing what methods to use and performing actual data analysis, you likely should be an author. However, the people you are working with may not be used to interacting with someone in the role you hold and may not understand what your relationship to the work should be. There are a lot of other people that contribute to scientific work that are not typically credited as authors, such as administrative staff, so it's easy to be confused. Being an author may also come with additional expectations and responsibilities, such as writing and revising manuscripts and presentations.
In cases where your level of input doesn't qualify for authorship, you can still ask to be acknowledged. I recommend not assuming that people are purposely slighting you, and instead explain to them how these sorts of things are important to you personally and professionally. Most people like to help other people out. When producing a figure for someone, you might say "I don't think my effort into this project is sufficient for authorship, but I would appreciate if you include my name in the acknowledgements section of your manuscripts and talks, and/or include my name in a slide presentation. This will help me be recognized professionally for the work I do so I can keep doing this job/get promoted/etc".
There's a lot of overlap between your role and statistical consulting, so you might find resources designed for statistical consultants are useful, such as https://community.amstat.org/cnsl/forclients/expect-content
See also previous Q&A here:
When does a statistical consultant become a co-author or collaborator?
Can an author claim sole authorship if the hired statistician writes half of the paper?
Medical Statistician: Concerned about missing authorship after conducting majority of project's data analysis, graphs, and figures
If you are creating resources that are useful across multiple projects such as software or databases, especially if these can be available to a broader audience than just your own institution, it may be worth creating a publication specifically for that resource that can be cited.