Diagnosis of prostatitis typically involves a combination of patient history, physical examination, and laboratory tests such as urine analysis and semen culture. In some cases, imaging studies like an ultrasound may be necessary to rule out other conditions.