This phrase is found in both old and new testaments.
Hebrews 12:28-29 Therefore let us be grateful for receiving a kingdom that cannot be shaken, and thus let us offer to God acceptable worship, with reverence and awe, 29. for our God is a consuming fire.
I had thought this came only from the account of God descending on the mountain when He gave the Ten Commandments.
Exo 24:17 Now the appearance of the glory of the Lord was like a devouring fire on the top of the mountain in the sight of the people of Israel.
The context of Hebrews supports that idea. However there is a two other instances which are perhaps more instructive.
Lev 10:1-3 Now Nadab and Abihu, the sons of Aaron, each took his censer and put fire in it and laid incense on it and offered unauthorized fire before the Lord, which he had not commanded them. 2. And fire came out from before the Lord and consumed them, and they died before the Lord. 3. Then Moses said to Aaron, This is what the Lord has said, Among those who are near me I will be sanctified, and before all the people I will be glorified. And Aaron held his peace.
In this account it was the priests chosen and appointed by the Lord who were killed. This helps us to understand the meaning of the passage in Hebrews 12 – the warning is to God’s chosen people who are called priests.
Num 16:35 And fire came out from the Lord and consumed the 250 men offering the incense.
This passage refers to the rebellion of Korah. Not only did those offering the incense die but the ground opened up and swallowed their families. Again, these were sons of Levi, chosen by God to serve Him in the tabernacle and who ultimately had no inheritance in the land because God was their inheritance. Yet it is they who are consumed by fire. So the passage in Hebrews is unquestionably referring to true believers who fail to honour the Lord. Jesus describes their judgment.
Mat 25:41 Then he will say to those on his left, Depart from me, you cursed, into the eternal fire prepared for the devil and his angels.