I have an Arduino Uno, controlling a 0.96" OLED on I2C bus. Works well.
I then connect a temperature sensor to the same I2C bus, but then the code is stuck at initialization:
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
If I use the I2C_scanner from the Arduino IDE example, then it finds both I2C devices.
The inputs should accept 3.3V as "high" as the threshold for reading "1" is 2.6V according to fig. 29-11 in the 328P datasheet with 5V as supply voltage.
OLED displays are known for disturbing the I2C bus for others. They are internally 3.3V, but are sold as 3-5V. Only Adafruit makes them compatible to 5V Arduino boards by adding a level shifter.
Can you tell what the temperature sensor is ?
Do you use cables ?
If the temperature sensor has a 5V I2C bus, then perhaps a level shifter for the OLED will help.