Public libraries serve communities and are open to all.
School librarians (or Library Media Specialists) work in K-12 environments, In many states, they're required to have a teaching license. Funding and staffing levels are often dependent on state or local policies.
There are a number of other types of libraries that don't neatly fall into the other categories. These are referred to collectively as "special libraries." Included in this group are law libraries, medical libraries, corporate libraries, government libraries, media libraries, and so on.