The United States entered the Vietnam war to prevent the spread of communism. China was already a communist country, and the United States believed that China would spread it to other Asian countries if it did not intervene.
Vietnam was divided between North Vietnam and South Vietnam. North Vietnam had control of the Vietcong, an insurgent group within South Vietnam. They were attempting to rise up within South Vietnam and push the communist agenda. The United States believed in the domino theory, which hypothesised that if one country fell to communism, the other countries surrounding it would fall as well, eventually spreading around the world.
Ngo Dinh Diem, the dictator of South Vietnam, was assassinated in 1963, escalating the conflict. Diem was a very corrupt dictator who faced a lot of opposition. Kennedy had backed a plot to have him overthrown.
North Vietnam had also attacked American soldiers and sank an American ship, adding further reason for the United States to join the war. The Cold War brought fear of communism to Americans, especially in the 1950s. The threat of communism spreading prompted the United States to take military action in support of the South Vietnamese. The Soviet Union had already adopted communism, and it was allied to North Vietnam.