I have black marks on face which are caused due to pimples. How to get rid of them?

Black head=comedone. These are commonly referred to as comedones. Simple extraction is effective. Various devices are available for this. Seek the evalaution of an aesthetician. Commerical adhesive strips may help. You may benefit from salicylic acid peels and/or dermabrasion or exfoliative treatments as well.
Chemical peels . Dark marks, or hyperpigmentation, can occur with acne either as a result of squeezing the pimples or in the natural course of their resolving. Once the acne is controlled the color will tend to self- correct if left alone but it may take a year or more. Prescription strength topicals may speed the clearance and chemical peels or lasers may clear the discoloration and control the acne even faster.
Scars? Hard to know if you are dealing with scarring or possibly blackheads. If you have active acne, that needs to be treated first. If otc meds aren't helping, see a dermatologist. If scarring persists after treatment, your dermatologist or facial plastic surgeon may recommend peels, laser treatments or topicals to improve the skin's appearance.