The Prophet ﷺ said: When one of you comes to the cattle, he should seek permission of their master if he is there; if he permits, he should milk (the animals) and drink. If he is not there, he should call three times. If he responds, he should seek his permission; otherwise, he may milk (the animals) and drink, but should not carry (with him). (Using translation from Abū Dāʾūd 2619)
قَالَ رَسُولُ اللهِ ﷺ «إِذَا أَتَى أَحَدُكُمْ عَلَى مَاشِيَةٍ فَإِنْ رَأَى فِيهَا صَاحِبَهُ فَلْيَسْتَأْذِنْهُ فَإِنْ أَذِنَ لَهُ فَلْيَحْلِبْ وَلْيَشْرَبْ وَإِنْ لَمْ يَكُنْ فِيهَا فَلْيُصَوِّتْ ثَلَاثًا فَإِنْ جَاءَ فَلْيَسْتَأْذِنْهُ وَإِلَّا فَلْيَحْلِبْ وَلْيَشْرَبْ وَلَا يَحْمِلْ»