CCC 2540 Envy represents a form of sadness and therefore a refusal of charity; the baptized person should struggle against it by exercising good will. Envy often comes from pride; the baptized person should train himself to live in humility:
Would you like to see God glorified by you? Then rejoice in your brother’s progress and you will immediately give glory to God. Because his servant could conquer envy by rejoicing in the merits of others, God will be praised.1
1 St. John Chrysostom, Hom. in Rom. 71, 5: PG 60, 448.