Libraries, once revered and essential institutions, are struggling to adapt with an increasingly digital age.