Medicine Inquiry

Doctor prescribed my daughter medicine for skin treatment, i am worried he prescribed a medicine for heartburn n acid indigestion. Is this okay to give this medicine to 4 year old ?