Thanks for your query,based on the facts that you have posted it appears that you have developed generalised infection of the scrotum and penis due to unsterile technique that you have adopted while shaving your private parts.
Please consult qualified general surgeon
for clinical examination and send the pus for culture and sensitivity to find out the organisms causing infection and antibiotics to which they are sensitive to.
In the mean while take broad spectrum antibiotics like Cefotaxime
along with anti inflammatory medication like Diclofenac
Ensure to wash your genitals with anti microbial solution like Betadine