"How do I pray for my unsaved friends and family members?"
"If it takes years to soften their hearts, continue praying."
Don't ever stop praying for your unbelieving friends and family. I have seen God answer those kinds of prayers again and again, even years after the person who was praying so intently went to be with the Lord. I can tell you that I am a believer today because my own mother prayed for me incessantly with tears, and I'm grateful she was alive to know that her prayers were answered.
I encourage you to pray very specifically for opportunities to witness to unsaved family and friends and for boldness to seize those opportunities when they arise. We should pray that they would have a life-changing encounter with Christ, that they would be on fire for the Lord, that they would witness to others about Him, and that God would use them in a mighty way to draw even more people to Himself.
Persevere in prayer. If it takes years to soften their hearts, continue praying. You may not see God's answer during your lifetime, but that's not important. What is important is that God answers prayer.