Ignore everyone recommending linear regulators.
You may be able to find one that has a very low voltage drop, something like 0.3-0.4v at 1.5A, but even that is really a lot ... With 12v input you'd be looking at 0.4v x 1.5A = 0.6 watts making it acceptable for 12v input, but at 24v input you're looking at around 15 watts wasted.
You'll have to decide if your opamps and whatever else you have can work with around 11v..11.5v, if such voltage would be sufficient.
The reason I ask is because if you plan to use a 12v wallwart adapter / power supply you may find that at 1..1.5A there will be some voltage drop over the length of the cable between the wallwart and your product, so you may get only 11.8v or even less.
If you choose to use a cheaper buck (step-down) only voltage regulator, such regulator would prefer to have some room between input voltage and output voltage, let's say at least 0.5v or something like that.
It would be hard to "optimize" a circuit to work with 24v and output 12v while also get it working with 12v input and 11.9v out or something like that.
If you want truly universal, you would have to go with a SEPIC (buck-boost) voltage regulator IC, which can take lower voltages or higher voltages and output a specific voltage - in such scenario I would probably choose to accept 9v...24v and output 12v.
There's some other option ... you could have a buck only dc converter circuit and and some small circuit that measures the input voltage and if it's less than let's say 13v, the circuit would turn on a mosfet or relay and take the voltage converter out, passing the 12v directly without conversion.
Look at a chip like AP63301 for a buck regulator ..
https://www.digikey.com/product-detail/en/diodes-incorporated/AP63301WU-7/31-AP63301WU-7CT-ND/10492238high frequency (500Khz) so small and cheap components, synchronous so no diode required, has an automated "LDO mode" where the input voltage is very close to output voltage , and can do up to 32v and 3A so 1.5A would not be a problem.
Datasheet is very detailed and even has example of layout of the components
Another easy to use chip would be AOZ1281 (1.8a max, 26v in max) or AOZ1283 (2.5A max, 36v in max) :
https://www.digikey.com/product-detail/en/alpha-omega-semiconductor-inc/AOZ1281DI/785-1276-1-ND/2769843https://www.digikey.com/product-detail/en/alpha-omega-semiconductor-inc/AOZ1283PI/785-1803-6-ND/9679281