Why is it ok for the US to attack other countries first without geting attacked first?

The only two justifiable wars was WWII after Japan attacked first and after the Sept 11 attacks. Fair. US got attacked and so retaliated.

Besides that, USA has a history of striking attacks at other countries without getting attacked first. In the Mexican war of 1846, the US was the aggressor and it was to expand territory aka the Manifest Destiny; literally invading.

The U. S. has landed troops in countries like Haiti, Nicaragua, and Cuba without being attacked first. Then in Panama (1989) they launched an attack to arrest Manuel Noriega, not in response to a direct attack. Why is it ok for the US to attack first but expect the countries to never retaliate but if they're attacked first, they tend to retaliate a lot worse?

Why is it ok for the US to attack other countries first without geting attacked first?
Post Opinion