Switching 12v pilot with 3.3v logic
How to power esp chip? Buy some 12v to 3.3v step down converter or I could use 2N2222 somehow?
  


You need to get a dedicated regulator. You can either get a linear regulator or a buck converter. The simplest approach is to use a linear regulator, you can find them really easy to meet your specs and are cheap.


  
  How to switch 12v using 3.3v logic? I know that I could use a relay, but they are operating on 5v logic and I would like to avoid 3 different voltage levels in this circuit.
  


You could use your 2N2222 as a switch. This is a BJT transistor, so you need to add an appropriate base resistor. It is well documented how to use a BJT as a switch, but in general, it looks like this:







simulate this circuit &ndash; Schematic created using CircuitLab

Now, you need to make sure your load current is within the specs of your 2N2222 (I think this is &lt;700mA). See this question if you want to know how to determine the appropriate base resistor value.

Another approach to switch 12V using 3V3 logic, is to use a MOSFET. You have to look for a "logic level" MOSFET—these have turn-on voltages down to even 2.5V, so you could easily find the one you need. Unlike a BJT (e.g 2N2222), you don't worry too much about the gate resistor (what we've called base resistor before), but you do care about having enough voltage to turn it on. You can find a lot more if you look for BJT and MOSFET as switches.