Hi Sara91
That message is important
It means the Arduino IDE cannot communicate with the Leonardo so the upload fails. Hence, the previous program continues to run.
Have you previously uploaded to this Arduino from your computer?
Before you upload, do you select Tools - Board - Leonardo from the Arduino IDE menu?
And from Tools - Serial Port, do you see a COM port for your Leonardo?
Regards
Ray