Unable to connect NodeMCU ESP8266 with Arduino IDE

I bought a NODEMCU 1.0 12E module about 5 years ago but haven't used it. Now when I upload the code(the Blink example) it shows the following error :

esptool.py v3.0
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_____....._____....._____....._____....._____....._____....._____
A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header

I did some troubleshooting, installed the CP2102 driver but still it doesn't upload the code.
Any help would be appreciated.
Note:- I am using MAC OS

hold the right button, when this sequence goes on the monitor, release

You mean the flash or the reset button?

flash button

Set the IDE up correctly following

Installing ESP8266 NodeMCU Board in Arduino IDE 2.0 (Windows, Mac OS X, Linux) and make sure you use a good quality data USB cable to connect it.

I tried but it is still not connecting.

I am sure i set up the IDE correctly. Maybe It is the cable which is making problem. But I changed it a few times and still it doesn't work.

Try with a different computer with a good data cable, if it does not connect, you probably have a faulty board.

The second option, press the button when the recording has started and hold until the dots on the screen stop, as they stop - release the button

Nope. Still doesn't work.

I tried it on both windows and mac.

It is probably a faulty board. Can't get a refund now.

I was somehow able to upload a code years ago, but now I forgot how to do it.

Almost all the boards behave for me, from the second or third time, when the blink is sewn up, they start working without this button

I think the board is working because when I open the serial monitor and press the reset button it gives some message.

rst cause : 2; boot mode: (3, 7)

ALSO

ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

yes. That is the one

Everything must be disabled from the module.

Can you please explain as I am not quite sure what you mean.

Open the serial monitor

Press and hold the BOOT button.
Press and release the RESET (or EN) button.
Release the BOOT button.

You should now see something like this in your serial monitor

ets Jan  8 2013,rst cause:2, boot mode:(1,7)

I am not getting that message. In fact I don't get anything when I do that.

But when I press and hold the flash button, then press and hold the reset button, the release the flash button first then the reset button. I get the following message :

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld

Is there anything connected to the module?