Exodus 23:9

9 “Do not oppress a foreigner; you yourselves know how it feels to be foreigners, because you were foreigners in Egypt.

Read Exodus 23:9 Using Other Translations

Also thou shalt not oppress a stranger: for ye know the heart of a stranger, seeing ye were strangers in the land of Egypt.
"You shall not oppress a sojourner. You know the heart of a sojourner, for you were sojourners in the land of Egypt.
“You must not oppress foreigners. You know what it’s like to be a foreigner, for you yourselves were once foreigners in the land of Egypt.

What does Exodus 23:9 mean?

John Gill's Exposition of the Bible
Exodus 23:9

Also thou shall not oppress a stranger
As these were not to be vexed and oppressed in a private manner and by private men, see ( Exodus 22:21 ) so neither in a public manner, and in a public court of judicature, or by judges on the bench when their cause was before them, by not doing them justice, showing a partiality to those of their own nation against a stranger; whereas a stranger ought to have equal justice done him as a native, and the utmost care should be taken that he has no injury done him, and the rather because he is a stranger:

for ye know the heart of a stranger;
the fears he is possessed of, the inward distress of his soul, the anxiety of his mind, the tenderness of his heart, the workings of his passions, his grief and sorrow, and dejection of spirit: the Targum of Jonathan is,

``"the groaning of the soul of a stranger": this the Israelitish judges knew, having had a very late experience of it:''

seeing ye were strangers in the land of Egypt;
where they had been vexed and oppressed, brought into hard bondage, and groaned under it; and therefore it might be reasonably thought and expected that they would have a heart sympathizing with strangers, and use them well, and especially see that justice was done them, and no injury or oppression of any kind.
California - Do Not Sell My Personal Information  California - CCPA Notice