A dc-dc step down converter is what you want. Heres one for 12v
https://www.amazon.com/Adapter-Converter-Reducer-Regulator-DC15-40V/dp/B01JAICAQY/ref=mp_s_a_1_1_sspa?crid=36RAW091RZPZR&keywords=24v+to+12v+step+down+converter&qid=1676318390&sprefix=24v+to+%2Caps%2C174&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUE5SDVXSE1NTExUN0smZW5jcnlwdGVkSWQ9QTA2NTg0MTEySEFCMzYwMTg1WUsmZW5jcnlwdGVkQWRJZD1BMDg0MzI1OFc5VUo1S0lDUVBNUiZ3aWRnZXROYW1lPXNwX3Bob25lX3NlYXJjaF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl