The field of medicine that specializes in the understanding, diagnosis, treatment, and prevent of mental problems is psychiatry.