The devil/hell to pay British American old-fashioned noun phrase informal
Used to say that someone will be in a lot of trouble, especially resulting from some action
If anything happens to that safe, there will be the devil to pay.
If teacher finds out you didn't do homework again, there’s going to be hell to pay.
There'll be the hell to pay if Luana sees that broken computer.
To punish someone or something harshly
Once something has been done, you can do nothing but face the consequences.
White lie
Act in a way that is likely to cause problems for you
The devil/hell to pay is a noun phrase, therefore it's often used after a verb to make a full sentense.
'There'll be the devil to pay' or 'There'll be hell to pay' is the common expression of this idiom.
According to the research of Word Histories, The phrase 'the devil to pay' refers to a person making a pact or bargain with the Devil: the heavy price has to be paid in the end. The best-known example is Faust (died circa 1540), a German astronomer and necromancer reputed to have sold his soul to the Devil.
The English phrase is first recorded in a manuscript dating from around 1475:
Better wer be at tome for ay
Þan her to serue þe deuil to pay.
In this manuscript, at tome appears to be a scribal error for at home and the sentence seems to translate as:
It would be better to stay at home forever
Than to serve here to pay the devil.
A variant of the devil to pay, hell to pay is first recorded in The miscellaneous and whimsical lucubrations of Lancelot Poverty-Struck, an unfortunate son of Apollo; by Joseph Lewis (floruit 1750-74):
Try to avoid to change something because doing something else could make things worse
I could have changed my answer, but I decided to leave well enough alone.