Putting mass-luminosity relation and Hertzsprung-Russel diagrams together leads us to a mass-age relation; so how do stars lose their mass over time? I think that the title is completely clear, but here's an expansion:

I was just reading about Mass-luminosity relation that says massive stars are more luminous than tiny ones. Well, let's talk about main-sequence stars for now. This relation becomes interesting when it's mixed with the Hertzsprung-Russel diagram that says young stars are more luminous than older ones (Originally says that hotter stars are more luminous and we know that hotter stars are younger).

So mixing these two relations produces some kind of Mass-age relation which says young stars are more massive, that is a star loses its mass over time, right? (Please tell me if I'm going wrong)

If this Mass-age relation is right, how do stars lose this extra mass during their evolution? And where does this stray matter go?
There is an alternative interpretation: Massive stars burn their fuel much faster than tiny ones. Hence massive stars are short-lived in comparison to tiny stars.

The lifetime of a star is proportional to about the inverse of the cube of its mass.
The Sun's lifetime is about $10^{10}$ years, hence for stars with 10 solar masses the lifetime is about $10^7$ years, and for stars with 0.1 solar masses it's about $10^{13}$ years.

But stars also loose mass, e.g. by stellar wind and coronal mass ejections. Heavy stars may loose mass (parts of their envelope) e.g. by pulsation or radiation pressure during their red giant or their Wolf-Rayet phases, before they explode as a supernova.