I have a few thoughts which I practice myself.
I never buy batteries or cheap electronics of dubious quality. This isn't just a problem that's restricted to China, although the bulk of those cheap, nasty and dangerous products seem to originate from there. Although good quality "brand name" goods aren't immune to manufacturing defects or poor design, the chance of one exploding into flames is greatly reduced. A lot of the fires that occur are caused by these cheaper products.
Aside from my mobile phone and laptop, I never leave batteries charging while unattended.
Finally, make sure you home/workspace is well prepared if a disaster does occur. Make sure you have adequate smoke alarms installed and test them periodically. If they are over 10 years old, replace them. Also have appropriate fire extinguishers on-hand (I have 3 large CO2 extinguishers at home). There are also specific water-based extinguishers designed to extinguish a lithium ion battery fire. If you're constantly handling LiPo packs (e.g.: in an electronics lab), have a fibreglass LiPo safe bag or two nearby where you can place damaged packs inside or for use while charging. A metal bin to contain a fire is also a good idea.