WorstMuppet made a great response, but there's a couple of other scenarios (I'll see if I can make a demo video for the first). You'll know you've done a CTS when you get a red/black lightning bolt appear just before the can impacts - classically, your direction will be diagonally up.
With the Wario fart, it was deployed on point - a luck shot, to be fair (but the key is to get it out there so it has a chance to save you) - his fart sent me into the mid-air can, which interrupted the fatal finish (the fart has AoE so it triggers/arms the can, which I then flew into).
WorstMuppet has covered canikaze on down-air and forward smashes (think unshieldable moves like Marth's shield breaker too - but be quick, because the attacks can also deflect the can).
The other way is with a short fall in up-B: when someone is camping the edge and your up-B isn't likely to make it - if the person on the ledge 'hits' the can, it becomes 'active' (that is, it will explode if it hits something - anything. That includes you. Normally it has a safeguard when unhit), which means if you purposefully fall into your own can, your up-B resets. Note, your can will harm teammates when it explodes (timed or opponent hit) - so it can be used to aid them as well.
There is another way that seems to involve wall rebounds but I haven't investigated it much (seems like a wall hit arms the can or something?). But if you know you're going to be short (due to some serious edge guarding) deploy the can early and shoot it like crazy so it becomes timed-active and self harm (up-B) into it for a knocked-back up-B reset.
I've KO'd so many down airs with a wall rebounding can it's not funny (classically it will explode you upwards, and them down diagonally). Note this only works on stages with walls for edges - angled edges are a different matter and are dangerous, see
this post.
CTS works best at low percent - moves like Ganon's punch (which have super armour and KOs at about 60%) or Little Mac's punch (again, super armour 60-80%) will classically be interrupted by a can where a shield (punch done whilst in air) or dodge (waits out the dodge) are ineffective. Just be wary of overrelying on CTS on dealing with downairs that can be easily dodged as the can has a slight chance of not triggering (if the attack hits the can it will 'deflect' and has a possibility of deflecting away whilst you go down). Best odds for CTS is when intersecting their hurtbox.
Edit: Further note, even if is CTS will be fatal, chances are their move would be - so instead of surviving, you just chip some additional damage for your next stock in trade-off for the shame of killing yourself.