You are correct to mention that France controlled Vietnam soon before Ho Chi Minh created the country of North Vietnam. However, China had not controlled Vietnam for over 100 years prior to this. Therefore, China is not particularly relevant to this issue.
Vietnam had been ruled by France in the years before World War II. But France was severely weakened at the beginning of that war. Germany conquered France and France lost its power to dominate Vietnam. When that happened, Japan (which was an ally of Germany) moved into Vietnam. Japan felt that it should be able to have a major empire in Asia. To that end, it took control of Vietnam.
Ho Chi Minh had been leading resistance against France before the war. During the war, he and his group resisted the Japanese, still wanting independence. He was helped to some extent by the US. After the war, Ho believed that Vietnam should be independent and he declared independence for the country.
The US did not support Vietnamese independence and allowed France to retake Vietnam. Ho continued to fight the French. It was not until 1954 that he and his followers defeated the French and were able to take the Northern part of Vietnam as an independent country.