Hi Mohammed Anas,
This error often occurs when the Media Creation Tool cannot establish a secure connection to Microsoft servers due to incorrect system settings, disabled TLS protocols, or network/security software interference.
In your situation, Windows 7 is EOL and using expired certificate and leading to the issue.
You may perform an In-place upgrade by using Windows 10 ISO to upgrade your system. Using Windows Media Creation Tool to get Windows 10 ISO from another machine, copy it to your Windows 7 computer to do so.
Disclaimer: Let’s try performing an in-place install or in-place upgrade which will refresh your Windows files and operating system without removing files or applications. That being said, we always recommend that if you have important data, you should back it up before making large system changes. If you want to back up your data first, please do so. Once you are done backing up, you can follow the steps in the following guides: How to perform an In-place Upgrade with Windows 10 Step-by-Step Guide - Microsoft Community
If you have further information, please feel free to let me know.