Alhamduillah, I have a lot of family cousins and friends but unfortunately they aren't as pious or religious as they could be. I do not want to seem arrogant, but none of them fit into the category of what a pious muslim is supposed to be like I try to be although I'm not perfect. Although they are good people, I feel very lonely because of this.

Are there duas to find good pious friends which can help me in this situation? I try to avoid spending too much time with friends or some cousins because I fear they'll drag me into haram and change me

Read this Dua:

اللَّهُمَّ رَبَّ السَّمَاوَاتِ السَّبْعِ وَ مَا بَيْنَهُنَّ وَ رَبَّ الْعَرْشِ الْعَظِيمِ، وَ رَبَّ جَبْرَئِيلَ وَ مِيكَائِيلَ وَ إِسْرَافِيلَ، وَ رَبَّ الْقُرْآنِ الْعَظِيمِ، وَ رَبَّ مُحَمَّدٍ خَاتَمِ النَّبِيِّينَ ، إِنِّي أَسْأَلُكَ بِالَّذِي تَقُومُ بِهِ السَّمَاءَ، وَ بِهِ تَقُومُ الْأَرْضَ، وَ بِهِ تُفَرِّقُ بَيْنَ الْجَمْعِ، وَ بِهِ تَجْمَعُ بَيْنَ الْمُتَفَرِّقِ، وَ بِهِ تَرْزُقُ الْأَحْيَاءَ، وَ بِهِ أَحْصَيْتَ عَدَدَ الرِّمَالِ وَ وَزْنَ الْجِبَالِ وَ كَيْلَ الْبُحُورِ

Then say Salawat and ask Allah for good friends, and beg Him when you ask. Insha’Allah He will surround you with good friends.