In the preceding verses Yeshua tells us not to judge:
"Judge not, that ye be not judged.
For with what judgment ye judge, ye shall be judged: and with what measure ye mete, it shall be measured to you again.
And why beholdest thou the mote that is in thy brother's eye, but considerest not the beam that is in thine own eye?
Or how wilt thou say to thy brother, Let me pull out the mote out of thine eye; and, behold, a beam is in thine own eye?
Thou hypocrite, first cast out the beam out of thine own eye; and then shalt thou see clearly to cast out the mote out of thy brother's eye." Matthew 7:1-5
A brother would be one that follows the Law and loves YHVH with all their heart and soul- either an Israelite or a Gentile that has been converted. That covers one group of people we are not to judge. The other group is the "dogs and the swine":
"Give not that which is holy unto the dogs, neither cast ye your pearls before swine, lest they trample them under their feet, and turn again and rend you." Matthew 7:6
The dogs and swine are those that are not considered a 'brother' or 'a son of God'. They are people of the nations that do not concern themselves with the righteousness of God's word.
"And, behold, a woman of Canaan came out of the same coasts, and cried unto him, saying, Have mercy on me, O Lord, thou Son of David; my daughter is grievously vexed with a devil.
But he answered her not a word. And his disciples came and besought him, saying, Send her away; for she crieth after us.
But he answered and said, I am not sent but unto the lost sheep of the house of Israel.
Then came she and worshipped him, saying, Lord, help me.
But he answered and said, It is not meet to take the children's bread, and to cast it to dogs.
And she said, Truth, Lord: yet the dogs eat of the crumbs which fall from their masters' table.
Then Jesus answered and said unto her, O woman, great is thy faith: be it unto thee even as thou wilt. And her daughter was made whole from that very hour." Matthew 15:22-28
Gentiles are the dogs and swine, yet we have been given favor from God because God is calling everyone to repent:
"From that time Jesus began to preach, and to say, Repent: for the kingdom of heaven is at hand." Matthew 4:17
"Then Peter said unto them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and ye shall receive the gift of the Holy Ghost." Acts 2:38
So we can tell the dogs and swine to repent, but if they have no desire to fellowship with us, then we are not to throw the precious word of God at them. They don't care and more than likely it will just make them very angry.
He that reproveth a scorner getteth to himself shame: and he that rebuketh a wicked man getteth himself a blot.
Reprove not a scorner, lest he hate thee: rebuke a wise man, and he will love thee.
Give instruction to a wise man, and he will be yet wiser: teach a just man, and he will increase in learning." Proverbs 9:7-9
Why would Yeshua ignore the Cannanite woman? Did he not care if she believed? Did he think that she was better off being sent to an eternal torture chamber to have her flesh burned forever and ever? No, of course not:
"Give ye ear, and hear my voice; hearken, and hear my speech.
Doth the plowman plow all day to sow? doth he open and break the clods of his ground?
When he hath made plain the face thereof, doth he not cast abroad the fitches, and scatter the cummin, and cast in the principal wheat and the appointed barley and the rie in their place?
For his God doth instruct him to discretion, and doth teach him.
For the fitches are not threshed with a threshing instrument, neither is a cart wheel turned about upon the cummin; but the fitches are beaten out with a staff, and the cummin with a rod.
Bread corn is bruised; because he will not ever be threshing it, nor break it with the wheel of his cart, nor bruise it with his horsemen.
This also cometh forth from YHVH of hosts, which is wonderful in counsel, and excellent in working." Isaiah 28:23-29