Disclosed are an extract with a detoxification pharmaceutical effect and a preparation method therefor. An effective component of the extract has the following chemical structural characteristics: a cholestenol compound with hydroxyl (OH) at position 3 and a double bond between position 5 and position 6, or a cholestenol compound with hydroxyl (OH) at position 3, a double bond between position 5 and position 6 and a double bond between position 22 and position 23. The extract can be extracted from AgrioIima agrestis. The extract of the present invention is safe in acute toxicity, sedative and hypnotic without physical dependence and psychic dependence, has an inhibiting effect on mouse excitability caused by morphine and benzedrine and a detoxification treatment effect on the abstinence syndrome in morphine-dependent rats, and can be used for development of drug abstention and detoxification food.