Dear student,
mass is the amount of matter present in an object. No matter what, mass always remains constant. This can be explained by the formula:
Mass= density× volume
We see mass is the product of density and volume. To change mass we have to change either volume or density. Now density is the amount of matter present in a given volume. Consider a case when we change density of a substance, i.e. we change the amount of matter in a fixed volume. So either we have to increase matter or decrease matter in the volume. Changing the density will accordingly changes the volume of the substance, and hence the mass remains constant. Consider a bundle of sand. You make a block of sand which can be divided into other 9 smaller blocks(like a rubics cube). So, if you have to change the density we pack the sand in the block more thicker or closely. On placing this sand more closely, the density increases but the total volume decreases, right? The number of blocks which occupies the sand will be reduced to 7 or 8. That is if you increase the density, the volume decreases accordingly so that the mass remains constant. Consider changing the volume. You apply high pressure on the sand such that the total number of blocks occupying sand reduces (less than 9). This will in turn increases the density, as the spacing between the sands will be reduced and they will be closely packed. Here also, mass remains constant as density increases as we reduce the volume.
always remember mass is the amount of matter present. You will learn in higher classes that you cannot destroy or create matter, which means mass remains constant. You will learn more about these in your higher classes. Then you will understand the concept better.
Thank you.