Non-Manifold to Manifold

Hi , i was searching for how to remove faces that make a mesh non-manifold .
any help ?

I have tested he mesh so far
Manifold.gh (9.6 KB)

mesh.ExtractNonManifoldEdges(false);