If you ever see the temperature gauge climb out of sight, whether flying or driving, you need to react instantly. Otherwise you will end up doing this.
If you’re flying a piston engine, you might check the cowl flaps or mixture. If the oil pressure is also dropping the engine will soon cease to exist. You must shut it down now and pull over or if flying, acheive best glide and look for a place to land.
Son#3 had to tear it down to the block and have the head machined after the high temperatures warped it. He did the repairs himself (with a little help from Dad) laboring evenings into the wee hours. His job and school became hobbies for the week. He rebuilt and replaced , buttoned it all back up and it still ran hot. Turns out that the computer was shutting down the cooling fans.
The garage now looks like a “garage” with grease stains and such but he persevered and it now runs like a top. He learned about driving from that.
Next on the menu: A turbocharger. His first choice was an LS1 engine retrofit but I’d lose my garage for months. Besides, how fast does he really need to go?