The verse in question says
So then, as we have opportunity, let us do good to everyone, and especially to those who are of the household of faith. (Galatians 6:10)
While the Bible teaches that everyone is precious in God’s sight (e.g., John 3:16; 2 Peter 3:9; 1 Timothy 2:4), it does not say we have the same level of responsibility in looking after everyone. For example, our first welfare responsibility is to our own families. Paul wrote to Timothy
But if anyone does not provide for his relatives, and especially for members of his household, he has denied the faith and is worse than an unbeliever. (1 Timothy 5:8)
So we have a greater responsibility for our relatives than we do for strangers. Similarly, Galatians 6:10 teaches that we have a greater responsibility for believers than for unbelievers. In fact, we often call other believers “brother” or “sister” (e.g., James 4:11; 2 Peter 1:10), thus making them part of our family.
Of course, this does not mean we can neglect unbelievers and those who are not relatives. The parable of the Good Samaritan shows that everyone we come across is a neighbour to whom we must show love. After all, the quotation we started with said “let us do good to everyone“.