The legislative branch writes laws, the judicial branch reviews laws and the executive branch enacts laws. The executive branch also has a veto power over the legislative branch as well as the power of executive order. All defined in law.
Oh so close, but it looks like the reading comprehension let you down again there. You got the bit about the legislature right, and then went a bit off the rails into wishful thinking again.
In the US (as in many countries), the judicial branch is not there just to review laws, it is to interpret and apply laws. If you end up in court facing a judge, it's that judge who sentences you, not your President. Where there is a question of interpretation, it is a judge whose job it is to render a judgement, appeals to which can be escalated to a higher court, ending in the (corrupt because it is politically appointed) Supreme Court, in the case of the US.
The executive branch doesn't have a veto over the rulings of the court. Donald Trump can't take a convicted felon and say, "that ruling, where this person was convicted, is reversed". What he can do is issue a pardon, so that the sentence that the convicted person had is no longer applied, like he did with all his pet insurrectionists. That's not a veto. Vetos don't work like that. That's a bit more homework for you to go and educate yourself before spouting off.
The executive branch is technically there to enforce laws, not enact them, but mostly their role is in conducting the business of government lawfully (i.e. within the law), and it certainly isn't to decide what the law says. The executive branch, by the way, doesn't consist of just the President, but also the police and armed forces. I know the police in the US like to think of themselves as judge, jury, and executioner, but they really should not, and there really should be more consequences when they take the law into their own hands. However, US gun culture is a whole other discussion, which I'm not going to get drawn into today.
The other branch, the legislative, is the one that makes the laws. Not the president, and, again, this is where the stuff with executive orders and vetoes is a bit iffy from a separation of powers point of view. Even then, though, executive orders have to be lawful, and can be overturned by congress with a two-thirds majority, as can vetoes.
What is currently going on in the US, which should alarm anyone whose head isn't firmly stuck up their own arse, is that one branch is in teh process of corruptig and drawing power from the other branches. The problem with the courts is that the highest court of appeal is stuffed with political appointees, and the problem with congress is that it is stuffed with Trump's yes-men (and, in the minority, women). This arises partly from the corrupting influence of money, where eyewateringly vast sums are spent to promote one political candidate over another. This leads inevitably to a plutocracy, becuase rather than a free choice, the electorate has a biased one, especially one where the candidates themselves are chosen by a less democratic method with all this "primaries" nonsense.
Anyway, after that littel diversion, back to your actual point:
And one thing the president of the USA is allowed to do, as head of the executive branch, is determine foreign policy.
This is true, yes, however, taxation is not foreign policy. Trumps tariffs are not primarily a foreign policy issue, they are an import tax on the citizens of the US. When someone buys something from China for $100, and pays $145 on top of that (or whatever the tariff is today), that person (in the US) is paying tyhe additional money to the US treasury. The Chinese seller still gets $100. Trump doesn't have the authority to set taxes in this way, Congress does. At last, this is what the judge has said in their ruling, and I'm more inclined to believe the ruling of an actual qualified judge than some anonymous nobody on the internet. The fact that Trump's argumentwoudl appear to be the same as yours only testifies to the fact that both his and your level of ignorance are roughly equal.