I usually start by looking at the docs for a non-trivial example or a Getting Started doc.
If those are insufficient, then I try to query an LLM, but that doesn’t always work depending on how recent the library is or how much the API of the library changes over time.