Unfortunately I recently heard of some others getting married, and I became sad. I am afraid that I experienced some form of jealousy. I thought "why can't I have this if they get to." I immediately asked Allah to protect them and their marriage with sincerity. How can I get rid of this evil thing in my heart and be happy for others instead?

Learn the duas and prayers that repel hasad and keep yourself in check just like you did above.