Unable to compile program

I know very well that the code is working, but when it comes to uploading it, it is not possible for me since it throws me the following error that you will show below.

Arduino:1.8.19 (Windows 10), Board:"Arduino Nano, ATmega328P"

Sketch uses 5194 bytes (16%) of program storage space. The maximum is 30720 bytes.

Global variables use 288 bytes (14%) of dynamic memory, leaving 1760 bytes for local variables. The maximum is 2048 bytes.

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

An error occurred while sending the sketch

This report could contain more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Why did you post in the Spanish forum? moved to the general English forum

do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).

—-

Have you tried to pick the old boot loader for your nano?

Why did you say it doesn’t compile when in fact it doesn’t upload

Do you have a NANO? If so, What NANO?
Have you tried 'old bootloader' from the tools menu?
Have you anything connected to the NANO?
What have you tried so far?