I am not familiar with Shrapnel Explosion, it sounds like a reaction?

In which order is the damage and healing applied?

It's relevant because let's say the Warlock is at 1 HP, the damage is 12 and the healing is 10. Would the Warlock end up at 0 hit points or at 10 hit points?

Two options...

Scenario A:

**Damage first:** Warlock is at 0 hit points. He falls unconscious.

**Healing second:** Now, he gains the 10 temporary hit points. But, from the section on temp HP:

**Result:** He remains unconscious and if he is hit again, the damage is reduced from his temp HP first, avoiding auto-failed death saves, until it is depleted.

Scenario B:

**Healing first:** Warlock has 1 hp, but gains 10 temp hp.

**Damage second:** Warlock takes 12 damage, entirely depleting his temp HP and dealing 2 remaining damage to his hit points, reducing him to 0 hit points.

**Result:** Warlock is at 0 hit points and has no buffer to protect him.

In either case, the Warlock is at 0 hit points. In the first scenario, he has some temp HP to help against attacks while he's down, and in the second he doesn't.

Ultimately, I would just apply both. Reduce the Warlock to 0 hit points. If the temp HP was greater than the damage minus his remaining hp, he has some temp hp still, otherwise he has nothing.