Cheap and good way to feed 12v digital input

Any SOT23 MOSFET could also have been used.