لَنْ يَّنَالَ اللّٰهَ لُحُوْمُهَا وَلَا دِمَاۤؤُهَا وَلٰكِنْ يَّنَالُهُ التَّقْوٰى مِنْكُمْۗ كَذٰلِكَ سَخَّرَهَا لَكُمْ لِتُكَبِّرُوا اللّٰهَ عَلٰى مَا هَدٰىكُمْ ۗ وَبَشِّرِ الْمُحْسِنِيْنَ ( الحج: ٣٧ )
Lany yanaalal laaha luhoo muhaa wa laa dimaaa'uhaa wa laakiny yanaaluhut taqwaa minkum; kazaalika sakhkharhaa lakum litukabbirul laaha 'alaa ma hadaakum; wa bashshirul muhsineen (al-Ḥajj 22:37)
Their meat will not reach Allah, nor will their blood, but what reaches Him is piety from you. Thus have We subjected them to you that you may glorify Allah for that [to] which He has guided you; and give good tidings to the doers of good. (Al-Hajj  : 37)
1 Mufti Taqi Usmani
It is neither their flesh nor their blood that reaches Allah, but what does reach Him is the taqwā (the sense of obedience) on your part. Thus He has made them (the animals) subjugated to you, so that you proclaim Allah’s glory for the guidance He gave you. And give good news to those who are good in their deeds.