A mineral is a naturally occurring, inorganic solid, which can be written with one chemical formula and which has a repeating atomic lattice structure. This later statement just means that a mineral is able to form crystals. Crystals have very specific shapes and ratio and these shapes and ratios are directed by their internal structure. Early mineralogists made very good guesses about these internal structures by using an instrument called a goniometer to measure the ratios of angles and faces in crystals of many minerals. Most of these guesses were proved to be either correct, or very close approximations when the minerals were investigated with more advanced technologies, such as x-ray diffraction.
The reason that the definition of a mineral concentrates on the lattice structure of the material, is because it is possible to have multiple minerals with the same chemical formula, but with different atomic arrangements. Materials which share the same chemical formula but different periodic arrangements are called polymorphs. Polymorphs have different crystal structures and different physical properties.
Mineraloids can also be described using one chemical formula, however they lack long range periodicity and do not form crystals. Natural glasses, opal are all examples of mineraloids. Amber and pearl, may also be described this way although both materials are organically mediated.