Trump is engaging in some light trolling here. He's going off script and just saying whatever comes across his mind. His overall goal is to lay out grievances and trying to upsell their severity. The end goal is, and always is, to make some kind of "deal". He's a Karen, trying to talk to the manager.
People shouldn't take his threats literally - but you should take them seriously. I don't think the threat is that the US invades Greenland, but that the US uses it as an excuse to try to sour relations with Europe.
Same thing with Panama and renaming the gulf thing. I don't think the US would take over Panama (again). But there is probably going to be a massive effort to get China to stop trading with Cuba and Venezuela.