using mixins: any time you find a bit of css that you need to use more than once.
building mixins: I assume you’re not askin about syntax, but logical approaches…? As with all programming, this would depend on the context.
mixin libraries: again, depends on context. At the very least, I would recommend putting them in a separate file so they’re isolated from other output and are easily reusable.
rolling vs. pre-made: if there’s a pre-made mixin that does exactly what you need, there’s no reason not to use it. Sometimes, you’ll have something specific to your project where it would be better to make your own.
Is this a purely academic question? or do you have a specific thing that you’re trying to solve?