If he declared martial law as a ploy to stay in office after his term ends, my best guess is that the Supreme Court would rule that he is just a private citizen and his actions have no legal force.
So, what would happen if Trump refused to recognize the Supreme Court ruling in this hypothetical? Presumably lower federal courts would refuse to recognize any actions by Trump. I suppose a few state and local courts might go rogue but it's hard to imagine it would have much effect.
It's not clear to me what would happen if Trump were to "terminate" federal employees who refused to follow his orders. The courts would undoubtedly rule that the "terminations" are null. This is all guesswork, but I but I suppose some federal employees might follow the former president's directives and remove the terminated employees from the federal payroll contrary to court orders.
I suppose he could declare martial law prior to the next election in an effort to avoid having an election, in which case he could assert that no successor has been legally elected and he is therefore the de facto president. I'm not at all sure what happen in this scenario. It would clearly violate the constitution, but I'm not sure if the Supreme Court would declare that the next in line (presumably the VP) is the president.
There's an old saw to the effect that the military ultimately decides the outcomes of illegal attempts to stay in power. Guns "trump" court orders when push comes to shove.
Attempting to use martial law or some other means to retain power would be extremely risky for Trump. If his attempt were to fail, odds are good he's spend the rest of his life in the slammer, or holed up in a foreign country somewhere.
I'm not sure how realistic any of these hypotheticals are. Even Republicans don't think he should seek a 3rd term.
>>>The Reuters/Ipsos
poll found that 53 percent of Republicans surveyed last week said Trump should not seek a third term.<<<