The treatment of mental disorders, as may be imagined, was peculiarly superstitious, and remained so longer than any other branch of medicine. Insanity was regarded as due to diabolical possession -- a view for which authority could be found in the New Testament. Sometimes a cure could be effected by exorcism, or by touching a relic, or by a holy man's command to the demon to come forth.
More info.: https://russell-j.com/beginner/RS1935_04-060.HTM