Thanks for your query,based on the facts that you have posted it appears that you had probably a sebaceous cyst on shaft of the penis which you attempted to remove and resulted in to injury
Please consult qualified surgeon to have inspection of the wound and to confirm whether you have excised it completely or not.
You need to take broad spectrum antibiotics like Cefotaxime
along with anti inflammatory medication like Diclofenac
Ensure to wash and clean the wound and apply topical antibiotic
ointment like Neosporine twice daily,