Coast Guard regulations require that your boat have certain equipment aboard.
In addition to life jackets, flares and other safety equipment, working fire extinguishers of the proper type are essential.
The three most popular fire extinguishers to have are Halon, Carbon Dioxide and Dry Chemical. Each have their advantages.
Despite some misconceptions, halon is still legal to use and pound for pound is the most effective clean agent type of fire extinguisher. The advantage of halon is it has excellent fire fighting properties and evaporates leaving no messy residue, causing no collateral damage to electrical systems not involved in the fire.
This type of fire extinguisher is also a good choice because in using CO2 gas, it will leave no residue and in itself will not damage your engine or electronics. They are bulkier than halon, however, so if space is limited, that may become a consideration. A 2 1/2LB halon has the same rating as a 5LB CO2.
ABC or BC dry chemical meets your legal requirements and are very effective in extinguishing fires. Their advantage is they are inexpensive. However, the disadvantage of dry chemical is it will spread throughout any compartment it is used and potentially damage electronics and engine components. The residue will remain and at the very least you will have a long clean-up job ahead of you.