Cant Upload code to ESP32 "Timed out waiting for packet header"

I try to upload simple Blink code through Arduino I get this error message:

An error occurred while uploading the sketch

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

I have tried most common fixes I have seen online, but nothing seems to work.

Got this a number of times : did you press the 0-button when it tries to connect to upload? Also make sure the serial monitor is closed as that can impact as well.

paulvha:
did you press the 0-button when it tries to connect to upload?

Hitting the 0 pin fixed this for me. Thank you!