It is useless to attempt to reason a man out of a thing he was never reasoned into.
Source, in full
Attributed to Swift in many places. According to the Oxford Treasury of Sayings and Quotations (Oxford University Press, 2011, p. 270), this quotation is "not traced in Swift's works", and is thus "probably apocryphal". It is possibly a paraphrase of a sentence in Swift's Letter to a young clergyman (see above): "Reasoning will never make a man correct an ill opinion, which by reasoning he never acquired".
Notes from Wikiquote
The earliest print cite to anything resembling this was found by Quote Investigator in a 1786 essay by U.S. Congressman Fisher Ames: "I have heard it remarked, that men are not to be reasoned out of an opinion that they have not reasoned themselves into."