Adding objects from previously saved blend-files, external libraries, and asset or kitbash sets tends to fill a scene with large numbers of identical materials, often dozens of them in complex projects. M-Cleaner finds the equal materials in the scene and removes the duplicates, reassigning a single unique material to the objects that referenced them.
Running it takes one press of the Clear materials button. A Remove unused checkbox controls what happens to the duplicates: with it on, they are removed from the scene immediately; with it off, they stay in the scene with zero users and are deleted by Blender's regular tools when the scene is saved. A separate Merge by name option cleans materials only by their names, clearing ones with .001, .002 and similar suffixes — the developer flags this mode as destructive.
The add-on lives in the 3D Viewport's N-panel under the M-Cleaner tab and supports Blender versions from 2.90 through 4.1. A demo video is available.