Is there any way to stop targeting other players when playing together?

Because sometimes when my friend stands nearby enemy target, i target my friend. And because of this my character stop attacking the enemy.

Play game well.It is the better solution.Targeting the people while playing the game is very fun.It’s give much pleasure and make interesting to play the game again.I think most of the games are targeting other people.