There is a way to guard against brainwashing. It is to have a faith in a higher (transcendental) Being (Creator) whose purpose and will governs the universe and everything in it and to base one's worldview on that reality. Then, anything that doesn't conform with the Creator's objective revelation of reality and purpose is instantly discarded.
I have been instrumental in rescuing several people with mental health issues through introducing them to God and His revealed Word - Jesus, the living Word, and the Scriptures which He attested were God inspired and cannot be broken. By grounding a person in this reality, they let go of previously held, delusional thinking and regain a sound mind.