Can the contingency spell trigger a cantrip? Ex. Could your death trigger spare the dying?
Yes, contingency can trigger cantrips, including spare the dying (assuming you can cast it).
Choose a spell of 5th level or lower that you can cast, that has a casting time of 1 action, and that can target you.
Cantrips are level 0 spells:
A cantrip’s spell level is 0.
So they are spells of lower than 5th level. The spare the dying cantrip has a casting time of 1 action, and can target you, so as long as you can cast it, it's a valid choice for contingency.
You should note, though, that it needs to be triggered by you reaching 0 hit points, not by your death.
You touch a living creature that has 0 hit points. The creature becomes stable.
If you've died, it's too late for spare the dying to help you. It needs to be triggered while you're still dying in order to save you.