the easy one first: the data pin 2 is PIN 24 on the EDP32 and that’s labeled ‘2’ or ‘D2’ or ‘IO2’.
IR receiver would connect to ‘4’.
The problem with the power supply is weird.
Did you use the pins labeled ‘5V’ or 'Vin" and ‘GND’ ? This should work with a 5V power supply.
However, a higher current surge happens during WIFI communication and thus at minmum a 470 uF capacitor should be soldered to VIN and GND (I personally use a 1000 uF capacitor everytime).
…and: the power supply itself should have an enough power to drive the LEDs and the ESP32 (500 mA for the ESP and 55mA per LED pixel for WS281x).
I would start adding that capacitor