It is also true that, while young bilingual children sometimes use words from two languages in the same sentence, they produce far more sentences using only one language. This clearly shows that they are able to keep their languages separate. They do it only when talking to people that they know can understand both languages and who do not get upset with them for using such sentences. In other words, the social context in which children find themselves determines whether and to what extent they use more than one language in a single sentence. However, learning language, even one, is a process that takes many years.
Languages are very complex.
To learn all their complexities, one needs a lot of life experience. The environment plays an important role in learning to speak. Children learn to speak only when they hear people talk to them in many different circumstances. Language development in the early stages depends crucially on vocabulary knowledge. The more words children know, the better they will learn to speak and the better their chances of doing well in school.