Is there a technique I can use here to diffuse the situation?
There are multiple things you can do. Most of your options fit into 2 categories: 1) Make sure the players can influence the outcome and 2) Use in-game encounters, imagery, sub-plots to lead up to the event. Preferably, do both. These bolded points are essentially the tl;dr version of this answer.
- Do not make it feel like the character has zero control over the situation.
"The ceiling collapses and you are completely crushed under literally 10 tons of rock. There is no surviving this. Bob the Valiant is dead."
While something like this is possible, it is never done because of the unspoken rule which is the opposite of the "rule of cool," that is, "If it's way uncool and does nothing but detract from the game, then do not do it." Something that purely and only detracts from the game, making it strictly less fun, should be avoided like the plague.
- Give the player choices, even if those choices are very strongly weighted against them.
"If that last encounter, which you fled from, seemed way overpowered that's because it was. Each of you gets a sinking feeling in your gut accompanied by a feeling of impending, foreboding gloom. You cannot quite ascertain the source, but you definitely feel a supernatural force at play, a force of malice in your path ahead. You are sure that the near future will break you if your destiny stays its course. This supernatural premonition leaves you feeling shaken for the rest of the day."
Then line up a bunch of totally overpowered encounters in the characters' very near future. The players then have a decision: stay on this course, or run from their current plot trajectory. For some of the encounters, either just before or just after them, give the group (or maybe 1 or more players specifically) some supernatural visions that foretell death - you could even let the vision show them what they will die from to make sure they realize running from an encounter is a very viable option.
If they run from this encounter, willing to sacrifice plot momentum for their characters, then make sure the visions include glimpses of the demonic force that is exacting its toll on them. That way, the players and their characters realize it might be time to revisit their mistake that led to this consequence, and if they still do nothing to fix that issue then any ensuing death is much harder to argue with.
You could even use GM fiat (unknown to the players) to say that an encounter does not result in death if the characters flee, thus increasing their influence over their situation.
This is still railroaded a bit, but not entirely. It still lets the players feel like they have a lot of influence over their situation, as indeed they do.
If the players realize that they put themselves in this situation and they decide to give in to their previous demonic deal and not try to cheat their way out of it, then you should make every effort to support that, even if it means you have to revisit your cool plot. You might write the story that is "the probable future," but the players help to write the story that actually unfolded. If it were me, and the players were literally between a force of overwhelming forces and a cliff and said "Damn our previous choices! We should not have cheated fate. If only we could go back and fix it." then I would have the demonic barterer appear and offer a way out.
Or maybe even have the demon appear within sight to watch their demise, whether the PCs called it or not (or whether they even realize at this point that it's their fault or not), and if the players are too dense to understand the nuances of what's going on it can make an offer, "Make good on your previous offer and this will all be over!"
- Whatever else you do (or not-do), keep giving the players the option to flee. If their characters are doing nothing but fleeing every encounter and essentially are failing at whatever they are doing, they will not likely want to keep doing that.
If they still do not play ball, you could provide some plot hooks to derail them from their current plot and do some other side plots for a while. This could essentially be a form of "laying low" from their previous happenings, doing something elsewhere, where their pursuer does not find them during that time.
If the players flee their entire plot for a while, you could make them feel bad about it by occasionally mentioning some negative side effect it is having on the world. Ex: The players just came from Cityville and are now in Townville, and the NPC spoken to says "Oh, and watch out! I hear demons are afoot. Half of Cityville is burned to the ground and lots of people dead when a demon came through looking for someone." This could continue until the players decide to get back on track with the primary plot.
- The death could be in the form of an impending death: perhaps poison, lycanthrope (not everyone survives it), some undead infliction, or just a generic "you will die in 1 week" curse.
This then makes a quest out of it, and the party can all work together to try to save the character. If they fail, then it's not just "You just outright killed him," but rather "We had the opportunity to save our friend and failed." Assuming the failed quest was possible to succeed at; if it was completely impossible then it might not have the intended effect.
You could kill someone close to the party instead of a party member itself. If there are any NPCs that the party really cares about a lot, consider them. And maybe the slaughter will continue if the root cause is not addressed, still possibly reaching the player's character in the end.
If other bad things are happening in the world as a result of the players' characters, perhaps the NPCs do not accept this. If the NPCs connect the dots, that the PCs friend was killed, later half a town was razed by a demon looking for them, eventually the city guard might just arrest the PCs and force them to deal with the root cause of the problem.
Notice that some of these suggestions for diffusing the situation can result in the character death not happening at all. Even if we do not consider the question an "XY problem," still, not actually killing the PC is, strictly speaking, an answer to the question as posed ("a technique to diffuse the situation").
After all, you said this was a result of mistakes the players made in the past that they don't want to fix, so using a good in-game way to influence them to fix their own mess could work. If they need to run away a lot or if everyone hates them (or worse, they become the countryside's most-wanted criminals) because of demonic action, then they have to face an epiphany: "Are we really good guys at all at this point? If we have cheated someone, demonic or not, and if we are willing to let innocent bystanders die for our gain, aren't we now the bad guys?" This is a classic struggle that some heroes have somewhere along the way.
The ideas above do not need to be viewed separately: they can be mixed and matched together, with some of them working quite well combined.