Dark matter is often presented as though astronomers invented something invisible to patch a hole. The reasoning is more constrained than that.
The observations
Galaxies rotate too fast. The outer stars of spiral galaxies orbit at speeds that should fling them away, given the visible mass. Something is providing extra gravity.
Galaxy clusters hold together despite the visible mass being insufficient.
Gravitational lensing – the bending of light by mass – shows more mass than is visible, and shows it distributed differently.
And the cosmic microwave background, the oldest light in the universe, has a pattern of fluctuations that matches a universe containing substantially more matter than we can see.
These are independent lines of evidence agreeing on roughly the same quantity, which is why the inference is taken seriously.
What it is not
Ordinary matter that is dark. Gas, dust and dead stars have been searched for and are insufficient. The microwave background also constrains how much ordinary matter can exist, and it is far less than the total.
The candidates
Particles that interact through gravity and barely otherwise. Decades of increasingly sensitive detectors have found nothing, which has ruled out large parts of the parameter space.
Primordial black holes formed in the early universe, constrained by other observations.
Or modified gravity – the idea that our equations are wrong at galactic scales. This explains rotation curves well and struggles with clusters and the microwave background.
Where it stands
Strong evidence that something is there. No detection of what.