Really interesting question! At a very basic level, surely this has at least something to do with thoughtful purchasing and organisation of books and other materials -- perhaps there needs to be a person or people on library staff responsible for auditing library content by topic area with this in mind?
I think they can have an important role, but there is also an extent to which libraries, as repositories, preserve existing power structures. For example, they make it possible to access books and journal articles which represent racist world-views and use of language that would not be accepted in research today. I don't know if there would be a way around this e.g. via curating and via search functions, or perhaps tagging certain items with trigger warnings to contextualise the content. I haven't seen this in academia but it is common enough in the broader media.
Thank you for the replies. I always find it difficult to talk about the transformative role of libraries because the sector seems to shy away from burning societal issues.
libraries as a potent avenue of generating knowledge should be responsive to the needs of time. Develop ways to digitize all references that anyone will be able to access those needed information for research.