I recommend the following:
1- Pray for your friend. Say Oh Allah, bless my friend. Bring him closer to you. Praying for your friend will help cure the jealousy in your heart.
2- Remember that Allah guided your friend, and you love Allah, and so you should love what your Lord does. Be comfortable with Allah’s decisions.
3- If you had prayed for your friend to be religious, then you will be rewarded for all the good your friend is doing. You will get a share of that. In reality you benefited by your friend becoming religious.
4- Pray two rak’as and gift them to Imam Mahdi (a), then directly talk to him and ask him to ask Allah to purify your heart from jealousy.