The question of what the matter of the universe consists of attracted the consideration of philosophers and scientists over many centuries.
By the early nineteenth century, the atomic theory was generally accepted.
Consider the ideas of some ancient Greeks
Galileo, Bacon, Boyle and Newton
How did Dalton's atomic theory develop?
Dalton's atomic theory
Comparing weights of atoms - atomic weights