Hard pimples in pubic area?

Maybe folliculitis. Pubic hair follicles can get infected easily causing a bumpy slightly painful eruption. Many other possibilities exist. Usually dermatological conditions need to be seen by a doctor to make sense of them. Please consult your doctor for an appropriate diagnosis and treatment. Photo is of a typical follicular lesion.
Agree with Dr. E. If you shave your genitals, quit doing that, it is unhygienic.