As a poor student who decidedly lost the grace and the fortune of his grandfather, before meeting Cosette, Marius was a radical who wanted nothing more out of life than to fight for the rights of the poor. Once he met Cosette, his entire world changed.
First, dying for the cause he at one time would have died for becomes a realistic fear. He'd rather have Cosette than anything else in the world. But he also realizes there is a class distinction between them. Marius is poor. Because of Cosette and Valjean's connections to the "Jondrette's," Marius finds himself entangled with Eponine, who both loves and deceives him. Because of Eponine, Marius believes he is about to lose Cosette forever. In despair, he fights at the barricade without concern for his life. He is wounded (though everyone else is killed) and is saved by Jean Valjean (who knows Cosette is in love with him). Valjean brings Marius back to his grandfather and as a result, the two are reunited and there is forgiveness. His grandfather encourages Marius' relationship with Cosette and financially ensures the marriage.
Ultimately, his love for Cosette propells his heroism as a revolutionary, saves his life, reunites him with his family, and secures him in a future that is expectedly lived in security and happiness.