In addition to the great contributions already here, here is something directly from Battery University which has tons of great info on Lithium batteries.
If a Li-ion battery overheats, hisses or bulges, immediately move the device away from flammable materials and place it on a non-combustible surface. If at all possible, remove the battery and put it outdoors to burn out. You may also put the device outside and keep it there of a least 6 hours.
A small Li-ion fire can be handled like any other combustible fire. For best result use a foam extinguisher, CO2, ABC dry chemical, powdered graphite, copper powder or soda (sodium carbonate). Halon is also used as fire suppressant.
FAA instructs flight attendants to use water or soda pop to extinguish a fire in the cabin. Water-based products are most readily available and are appropriate since Li-ion contains very little lithium metal that reacts with water. Water also cools the adjacent area and prevents the fire from spreading. Research laboratories and factories use water to extinguish small Li-ion fires.
A large Li-ion fire, such as an EV, may need to burn out as water is ineffective. Water with copper material can be used, but this may not be available and is costly for fire halls. When encountering a fire with a lithium-metal battery, only use a Class D fire extinguisher. Lithium-metal contains lithium that reacts with water and makes the fire worse. Only use the Class D fire extinguisher on lithium fires.
''CAUTION Do not use a Class D fire extinguisher to put out other types of fires; make certain regular extinguishers are also available. With all battery fires, allow ample ventilation while the battery burns itself out.''