Mass (inertia) is not a simple, straightforward idea. The first complication, known since Newton's time, is that there are not one but two kinds of mass - inertial mass and gravitational mass. Inertial mass measures the inertia of an object - how much it resists accelerating. On the other hand, Newton showed that two objects exert a mutual gravitational force on each other that is proportional to each object's gravitational mass. (This is called the Universal Law of Gravitation.) Gravitational mass, then, measures how much an object contributes to a gravitational attraction.
Newton observed that inertial mass and gravitational mass both depend on the amount of matter in an object, and so are proportional to each other. By a proper choice of units, they could be made equal - but he could think of no logical reason for this connection. Why should resistance to acceleration affect gravitational attraction, and vice versa? No other physicist could explain it either, until Einstein's General Theory of Relativity in 1915.
If you are not particularly impressed with the distinction between inertial mass and gravitational mass, that's just fine at this point. It is not really a distinction that a beginning physicist needs to make. Historically, however, it is an important distinction, and it doesn't hurt to be aware of it.
If there is one thing that a person selected at random is likely to know about physics, it is the equation E = mc2, which is another consequence of Einstein's Special Theory of Relativity (1905). They probably don't know what it means, but it is the most famous equation around.
In this equation, E stands for energy, m stands for mass, and c is (again) the speed of light. Many people interpret this equation as "mass can be converted into energy" - but that is not what it says. The equation says that "mass is energy". It is a very concentrated, highly organized form of energy, but mass is energy, none the less. (Don't get confused (ha!) here - this aspect of mass is NOT due to motion, even though the speed of light is involved.)
Here again, this strange aspect of mass has been confirmed experimentally many times. This mass/energy equivalence does not arise in "everyday" interactions; however the source of energy in atomic power, and the energy to power the Sun and other stars, is mass.
Why does matter have inertia? Nobody knows. Of course, there have been a lot of hypotheses and much speculation about it.
Ernst Mach, near the turn of the century, thought that objects had mass due to the interaction of all of the particles in the universe - an interesting idea.
More modern hypotheses say that matter has mass due to an interaction with the so-called Higgs field, mediated by the Higgs boson. So far, no Higgs particle has been detected, though. String theorists ("strings" are the hypothesized fundamental constituents of all matter, from which electrons, quarks, etc. are made) believe that mass arises due to the wiggling and twisting of their multidimensional strings, but the details are not yet worked out, much less an experimental test.
Even if it turns out that inertia is due to the Higgs mechanism, or some aspect of strings, this just moves the mystery, doesn't it? Why the Higgs particle? Why strings?
Another aspect of mass is that although all matter has mass, it may be the case that "things" other than ordinary matter may also have mass.
When a very massive star runs out of nuclear fuel, there is no longer any force to oppose the inward pull of gravity. Theory predicts that under the right conditions such a star may collapse completely to a "black hole".- essentially a mathematical point that may theoretically accumulate unlimited mass.
Observational evidence (indirect evidence, since black holes are invisible - the gravitational field is so intense near the hole that not even light can escape...) continues to accumulate that black holes actually exist. In fact, it would be difficult to find an astronomer who doubts the reality of black holes.
So, black holes, if they actually exist, do not contain ordinary matter like protons, neutrons, and electrons - yet they have enormous mass. So mass is a property of matter - not vice versa.
For further information on black holes:
The galaxy NGC 4414 imaged by the Hubble Telescope
The problem is that these massive halos don't seem to be there. The rotation rates and visible mass are measured precisely. The physics of rotation is certainly well tested - yet the mass necessary to rotate the galaxies just isn't there - hence the "missing mass problem".
If the "missing mass" were made of any kind of ordinary matter, it would be detectable somehow - this stuff isn't. There have been a lot of interesting (and interestingly named...) theoretical candidates for the missing mass - WIMPS (Weakly Interacting Massive Particles), MACHOS, etc. It will be interesting to see how this one comes out! Whatever, the missing mass seems to be another case of mass without matter. .
All of this stuff about mass has not been presented to confuse you (believe it or not), or boggle your mind. Certainly, as a beginning scientist, you don't need to grasp all of the various aspects of mass, but you should be aware that the true story about mass is still being written - mass is more interesting than just the "quantity of matter".