Provided in the present invention is a use of methyl 4-[9-(6-aminopuryl)]-2(s)-hydroxybutyrate in the preparation of a medicament for treating psoriasis and vitiligo. More specifically, the present invention uses mice whose psoriasis is induced by an imiquimod cream to observe a changing condition in skin lesions on the psoriasis-like mice, according to a psoriasis skin lesion area of the mice and grading standards for disease severity; the present invention also observes a proportion of lymphocytes in the spleens and cytokines in skin lesion tissues of the mice. A good therapeutic effect may be obtained by treating typical cases of vitiligo with an ointment of methyl 4-[9-(6-aminopuryl)]-2(s)-hydroxybutyrate. Results show that methyl 4-[9-(6-aminopuryl)]-2(s)-hydroxybutyrate used in the present invention has a good therapeutic effect on psoriasis and vitiligo, as well as a favorable prospect in clinical application.