Esp32 doesnt work with ssd1331 Oled

CS should be 5 or 15 for the Arduino Core.

post a image of the oled wired in.

I'd not use 13 for RST if your having issues. GPIO_NUM_13 is the TCK pin and can be used during programing and boot by the ESP32.

Is the oled a 3V3?