How does a newborn calf knows from where it has to take milk?
Satisfying the need to get sustenance would be considered a basic need for species survival, and thus to some extent it is innate. In the wild, an animal that didn't satisfy the need would perish.
Within a half hour or so from birth, the newborn calf will stand up, and start butting its head, and sucking on anything that is nipple shaped (the head butt may help with milk flow). The calf initially won't know to go directly to the utter, but will have some idea of what to look for.
The cow may also gently push the calf to the right position, and present her utter to the calf. During this time, cooperation of the cow is essentially necessary.
After the first taste of milk, the calf rapidly becomes more coordinated, and learns exactly where to get it. While some cooperation of the cow is still helpful, some calves can learn to snitch a few bites from uncooperative mothers.