Dark matter is matter that responds to, and causes, gravity but not electromagnetism, e.g. light, which is why it is dark. Even though it can't be seen cosmologists have measured how much there is is several very different ways and, remarkably, all the methods agree.