Dear student,
Most stable oxidation state of Lanthanides is +3. But some show +2 and +4 oxidation states due to presence of half-filled or fully-filled or empty f-sub shells.
Cerium's atomic number = 58
electronic configuration = 1s2 2s2 2p6 3s2 3p6 4s2 3d10 4p6 5s2 4d10 5p6 4f1 5d1 6s2
So, it shows +4 oxidation state because after losing 1 electron from the f sub shell it attains noble gas configuration.
Regards