Scientists know that dark matter exists primarily because:
They observe gravitational lensing bending the light of other objects in space.
Gravitational lensing occurs when massive objects, such as galaxy clusters, bend the light coming from objects behind them. The extent of the bending provides evidence for the presence of mass that is not visible, which is attributed to dark matter. Other evidence, such as the rotation curves of galaxies and the large-scale structure of the universe, also supports the existence of dark matter.