I’m not sure exactly how to view this verse. I don’t view it as something to be practiced today.
It would seem to me that Exodus 22:18 is spoken to the people of Israel and if I was to guess, apply to their own land of Israel. I’m not sure if this is only when the people of Israel were going into their land to inherit it or while they were living in their own land.
I would not mind hearing the perspective of a person who has studied the Old Testament in depth on this particular verse.
I've consulted my commentaries for you and here's what they have to say on this verse:
(I typed them myself so please excuse errors
)
Ramban (13th century):
In connection with all those who are guilty of death, He has said above:
moth yumoth (he shall be surely put to death), meaning he is liable to death, and it is a positive commandment upon us to slay him, based upon the verse which says,
and thou shalt put away the evil from the midst of thee, or it may be that this obligation on us is derived from the very expression
yumoth (he shall be put to death), which He used in these cases. But here, however, He did not say, "a sorceress shall be put to death", but in this case He warned us in a stricter manner by means of a negative commandment, that we should not suffer her to live.
The reason for this is that the sorceress is defiled of name and full of tumult, and fools are misled by her, therefore He was more stringent and admonished us with a prohibition. We find a similar severity in relation to all those who cause snares for many people, such as that which He said in the case of the misleader after idols,
neither shalt thou spare, nor shalt thou conceal him, and in the case of a murderer He said,
And ye shall take no ransom for the life of a murderer, that is guilty of death.
Rabbi Hertz (early 20th century, tends to be a bit polemical against Christians):
Not because there was any reality in witchcraft, but because it was a negation of the unity of God and an abominable form of idolatry. It is noteworthy that the Septuagint translates the Heb. word for sorceress by 'poisoner'. Ancient witchcraft was steeped in crime, immorality and imposture; and it debased the populace by hideous practices and superstitions. Hence the place of this commandment in this chapter. It is preceded by provisions against sexual license (v. 15) and followed by condemnation of unnatural vice and idolatry (v. 18 and 19). The wording of the command is an unusual form. We should have expected, 'A sorceress shall surely be put to death.' Some commentators, therefore, explain it as a prohibition of resorting to the sorceress, and thus enabling her to thrive in her nefarious avocation. The law applied to the sorcerer as well (Lev. xx, 27).
It is fashionable to trace all the horrors of the persecution of witches in mediaeval times to this verse. There is no justification for this. Witchcraft as a sinister danger in Jewish social life ceases to count long before the destruction of the Second Temple. (The incident in connection with Simon ben Shetach is no proof to the contrary. Both Jewish and non-Jewish scholars - Dernbourg,
Essai, 69; Israel Levi,
Revue Des Etudes Juives, xxxv, 213; and Strack,
Einleitung, 118, - have made it the subject of investigation, and are agreed that is is merely Haggadic).
Later Jewish teachers (Samuel Ibn Chofni [10th-11th century] and Ibn Ezra [12th century]) are among the earliest to deny the existence of demons or the efficacy of witchcraft. The hideous cruelties in the medaieval trials of witches would have been impossible in Jewish judicial procedure. Torture to extort confession was unknown in Jewish law; and no confession on the part of the accused, that would have involved capital punishment, was allowable. 'No man can in law brand himself a criminal' is a principle in Jewish criminal law. Christianity, furthermore, which disregarded portions of the Decalogue (e.g., the Second Commandment with regard to the prohibition of image worship; and the Fourth Commandment, with respect to the seventh day as the Sabbath) would certainly not have been guided in its attitude towards witchcraft by any single verse in the 'Old' Testament, if the New Testament had not been a demon-haunted book. Down to quite modern times the Church ascribed reality to the works of witches. In Germany alone, no less than 100, 000 women and children are said to have suffered a cruel death during the horrible hunt for witches that disgraced the sixteenth century. So late as 1716, a woman and her daughter of nine years were hanged at Huntingdon for raising storms by witchcraft.
Rabbi Hirsch (19th century) - I only transcribed the relevant part,
So literally, to put into a net, to bring completely out of all contact with all other existence i.e., to cut off by death. If we consider the three crimes which are here given as types for these three categories, we can see how, from their innermost nature, they comply with what we have assumed to be the reason for the differentiation.
כישוף (spell/sorcery/witchcraft) according to our way of understanding it (adopting it from Maimonides) [is] nothing but deception, nothing but an assumed mastery of God's Laws of Nature, would be rather a folly to be smiled at, or a madness to be pitied, than a crime to be punished, were it not that it exercises such a deep demoralising influence on the community. כישוף has always been practiced only in the service of immorality and crime. For matters which were in accord with the Deity one could trust to the intervention of Divine Providence. Only for matters where one knew that one was in opposition to the Divine Will was one driven to try to find a by-way, some indirect means by which to gain one's end without the assistance of, and against the laws of a benign Providence. It was in response to this demand that the wizard worked
. The Gemora (Sanherdin 67b) aptly explains the word מכשק (witchcraft) as an abbreviation which can equally well mean : "They that deny all the forces of nature are under the control of a higher power, the Divine Will", or "they allege that they can paralyse the forces of nature which are controlled by God alone, and which fulfil His Will alone". It is to show how ridiculous in itself such a procedure is, that here, the only time in the scriptures, מכשק is written in the feminine מכשפה, whereas elsewhere it always occurs in the masculine. The witch - whose supposed art is quite usually practiced by any old woman, and this also shows the absurdity of its pretentions - as such does
not deserve death, so it does not say moth yumoth, but nevertheless 'shall not suffer/let',
because of the erroneous ideas which he spreads, and the devastating effect he has on morality.
Hope that's at least somewhat helpful for you