The two ways to replace an original iPhone 4 charger are to purchase a new one or contact Apple for a new charger. If the phone is still under warranty, the charger may be free.
The iPhone 4 uses the 30-pin charger, so when buying one, choose that option and not the lightning charger, which is for iPhone 5 and above. The 30-pin charger is flat and wide, and the lightning charger is small and thin. The lightning charger does not work with an iPhone 4 unless using an additional adapter.
There are several manufacturers that make chargers that work with the iPhone 4, and these are available at department stores, electronics stores and online at websites such as Amazon.com and WalMart.com. Some prefer an Apple-brand charger or a brand that Apple recommends. To find these, shop at an Apple Store, or buy online at Apple's website. Many iPhone 4 charging cords come with a wall charger or other adapter, which may affect the cost.
If the iPhone 4 is under warranty and the charging cord breaks, Apple replaces the cord without payment. Go through the Apple website to fill out a form, or call the company to verify that the warranty is in tact. If so, order the new cord; Apple may ask for the defective cord.