The disciples complain to Jesus about some guy driving out demons in his name, even though he's not one of them. The question here is about people who are doing stuff in Jesus' name or to promote Jesus or maybe just doing good like Jesus did without actually trusting or following him personally. What Jesus says here needs to be seen in the context of other things he said like in Matthew 7:21-23 where Jesus makes it clear that no amount of good deeds will get anyone into heaven but the only way in is for people to know him. The point Jesus makes here though, is that it's good to do good (and there are even rewards that come with it in this life) and his followers should affirm people in this, rather than discourage them.
Continuing the same line of thought, Jesus says that causing young Christians to stumble as they trust and follow him is a serious offense. Young or new followers of Jesus need nurturing, encouraging and mentoring. We're all learning and we need to stay humble. Disqualifying, discouraging or giving up on any Jesus follower for making mistakes or for having wrong ideas is totally unhelpful and is something that makes Jesus incredibly angry. The violent drowning death he describes in verse 42 makes this very clear.
So it's about starting where people are by:
1. Affirming the good that people do, even if they don't know Jesus yet.
2. Encouraging young or new Jesus followers and challenging them compassionately.