The United States placed trade restrictions on Japan because of Japan's imperial aggression in China and then (in 1941) because of Japan's move to occupy French Indochina.
"Before World War II" is a problematic phrase. If viewed from the standpoint of Asia, what became World War II already began in the 1930s with Japanese imperial aggression into Manchuria, to take over Chinese territory. Beginning in 1938, the United States adopted increasingly severe trade restrictions against Japan in response. When Japan moved into French Indochina in 1941, the USA froze all Japanese financial assets in the USA and placed an embargo on all oil and gasoline shipments to Japan. The Japanese viewed the embargo as an act of war, and their attack against the US at Pearl Harbor was (from their viewpoint) a response to US trade sanctions against them.