With most projects you are likely to want to use publicly-available libraries and that usually means searching for them on GitHub. In most cases, there will be several to choose from. Here are some things to look for on a GitHub repo when selecting a library.
More stars usually means more people are interested in a repo and have thought about using at some time. However, not everyone is diligent in unstarring a starred repo, so this might bias you towards selecting not the best, but the most-established repo.
Watchers of a repo get pestered whenever there are any discussions on issues, so these tend to be a better indicator of actively-interested users.
Lots of recent commits from several different users is usually a good sign of an actively-maintained library.
Things to look for are how many open vs closed issues; how swift are the responses by the maintainers to issues raised by users; and how well-labelled are the issues. All these indicate that the maintainers are active, responsive to the community and well-organised.
The shape of the contributions graph and individual contributions tells you a lot about the health of the developer community over time.
A well-written README with easy-to-follow usage examples is always a good sign.
Andrew nesbitt has created a fantastic resource called Libraries.io, that makes it easier to decide on which library to use, by condensing the research tasks above into a single search.