The unexpected attack of Japan on the US naval base at Pearl Harbor, Hawaii, became exactly the reason why the US entered World War II. 350 Japanese aircraft destroyed 18 US naval vessels, 8 battleships, 300 aircraft, and killed about 2,400 people. Such losses could not be tolerated in any possible way, and the US declared war on Japan on December 8, 1941. In return, Japan allies, Germany and Italy, declared war on the US three days later.
Apparently, the main reason why Japan made such an attack was the US cutting off its oil exports to Japan the same year. Japan heavily relied on American oil, and the US technically deactivated Japanese navy without their oil supplies. Also, Japan might have hoped for domination in the Pacific after they had destroyed the US fleet. After a wave of New Imperialism, Europe and the US had their colonial lands in Japan, and the latter also expected to win back its territories caught by foreigners.
Historians can hardly claim that the US could somehow prevent the Japanese attack. It could have been predicted or coped with, but there was no chance to rewind the events. In fact, General George Marshall had received and translated a decoded Japanese message on the very day of the attack. Nevertheless, he failed to deliver it to Pearl Harbor on time. Such a huge military intervention could not remain unaddressed, and the US joining World War II also looked inevitable. International conflicts like this have a complex nature, and it is impossible to rewind events and solve arguments in a peaceful way.