Setting is the far future. Magic & science are rather blended. The character I remember is a dwarf, and he’s a technology guy (could be 2 different characters, but I’m thinking they’re the same guy). He’s part of an intrepid band trying to keep civilization together. They find an underground cache of technology, some of which is robots which he (the tech dwarf) eventually gets working and thus saves the day.
I was thinking it was Jack Vance, it has his feel to it, but that might be my imagination.
I’m guessing it will take less than 90 minutes for the answer to appear.
Although I haven’t read the novel myself, this sounds somewhat like descriptions I have read of Edmond Hamilton’s 1951 novel The City at World’s End, in which in the far future people get technology working again to revitalize a dying world. I don’t know if there’s magic in it (or people assume it’s magic), or a dwarf. Hamilton later adapted this story into a Superman script (Hamilton wrote for DC comics for a while, too), “Superman Under the Red Sun” (Action Comics #300, 1963), in which Lex Luthor (!) saves the devolved civilization by re-activating robots.
There are plenty of after-the-apocalypse/civilization collapse novels in which the rediscovery of technology saves people. Poul Anderson’s Vault of the Ages, for instance (one of the first sf novels that I read). There are probably an awful lot that come close to your description, if not fitting precisely.
If it were Jack Vance it wouild be The Dying Earth - the chapter with Rogul Domedonfors mixed with the final chapter featuring Guyal of Sfere at the Last Library, iirc.
Not an exact fit, but maybe close enough.