You need to reject such verses.
Why are these verses there?
Hinduism has never had a centralized organization that enforces quality control. Just read the Gita verse posted below. Gita is complaining of errors in scriptures.
When your intellect, fed up with the bewildering scriptural doctrines
and their interpretations, settles (finally) in steady and unwavering
introspection (in the spirit), then you will attain to real Yoga.
A Hindu should do what he thinks is right and not blindly follow ancient texts. You might ask why instead of guidelines ancient Hindus didn’t throw out the discriminatory verses from these texts. There are at least two reasons for that. The first reason is that in the absence of printing press no text was safe from modification. A scholar copying a text can easily modify a text. The second reason is that Hinduism has no centralized organization to check errors in scriptures. Ancient Christians had the Church to select the texts that were considered to be correct and dump texts that did not reflect Christian teaching. Similarly one of the righteous Caliphs, companion of the Prophet, Uthman burnt down all variants of the Koran and commissioned a scholar to write the most authoritative version of it. Since Hindus do not have any such organization they have to look at scripture to see what it says about this issue. Hindu scriptures ask Hindus to do internal consistency checks before accepting any scriptural statement as valid. Hindu scriptural verse must survive three checks in order to be acceptable.
Even the words heard from an ignorant person, if in themselves they be
fraught with sense, come to be regarded as pious and wise. In days of
old, Usanas said unto the Daityas this truth, which should remove all
doubts, that scriptures are no scriptures if they cannot stand the
test of reason.
Mahabharata Shanti Parva Section CXLII
Acharya Shankara says:
The appeal to the infallibility of the Vedic injunction is
misconceived. The infallibility in question refers only to the unseen
forces or apurva, and is admissible only in regards to matters not
confined to the sphere of direct perceptions, etc ... Even a hundred
statements of sruti to the effect that fire is cold and non-luminous
won't prove valid. If it does make such a statement, its import will
have to be interpreted differently. Otherwise, validity won't attach
to it. Nothing in conflict with the means of valid cognition or with
its own statements may be imputed to sruti.
REF: Srimad Bhagavad Gita Bhasya 18.66 of Sri Sankaracarya translation by Dr. A. G. Krishna Warrier
yuktiyuktamupādeyaṃ vacanaṃ bālakādapi | anyattṛṇamiva tyājyamapyuktaṃ
padmajanmanā || 3 ||
The remark of a child is to be accepted, if it is in accordance with
reason; but the remark of even Brahma Himself, the creator of the
world is to be rejected like a piece of straw if it does not accord
REF: Vasistha's Yoga translated by Swami Venkatesananda, p 35.
If a holy act is against the interest of other members of the society,
it should not be practiced. It is Dharma which is the source of Artha
and even of Kama.
Kurma Purana I.2.54
If a scriptural verse does advocate discrimination then throw that verse into the nearest trash can.
- The whole Veda is the (first) source of the sacred law, next the tradition and the virtuous conduct of those who know the (Veda
further), also the customs of holy men, and (finally)
Manu Smriti II.6
Bhishma said, ‘He is said to be conversant with duty who knows duty as
depending on four foundations.’
[four foundations, i.e., as laid down in the Vedas; as laid down in the Smritis; as sanctioned by ancient usage and customs; and as approved by the heart or one’s own conscience.]
Mahabharata, Santi Parva, Section CXXXII
Hindu scripture can’t override reason and conscience. Nor can Hindu scripture be used to discriminate against a community.
The Smriti texts and the Puranas that we have today reflect the attitude of people who lived many centuries ago. Most of these texts have been revised many times. These texts teach us to adapt these teachings to modern times and in fact discard any teaching that seems obsolete today.
Swami Vivekananda encouraged rejection of Smriti and Puranic verses that are clearly obsolete.
The Smritis and the Puranas are productions of men of limited
intelligence and are full of fallacies, errors, the feelings of class
and malice. Only parts of them breathing broadness of spirit and love
are acceptable, the rest are to be rejected. The Upanishads and the
Gita are the true scriptures.
The Complete Works of Swami Vivekananda/Volume 6/Epistles - Second Series/CXXIV Sir
However, discard the desire (kama) and material wealth (artha) if
contrary to Dharma; as also, any usage or custom or rules regarded as
source of Dharma if at any time they were to lead to unhappiness or
arouse people's indignation.
(Manu Smriti 4.176)
A Hindu should only take the essential teachings and not be a fundamentalist.
An intelligent man should seek the essential teachings of all
scriptural texts of varying importance, just as a honey-bee sucks the
essence of all flowers.
Srimad Bhagavata Purana XI.8.10