Hi @adil ,
You'd better try browsing to the Security Token Service web service to verify that the web service is "started" in IIS and available for requests. The Security Token Service is a web service hosted under the “SharePoint Web Services” IIS site, in a virtual directory called SecurityTokenServiceApplication. If the SecurityTokenServiceApplicationPool has been disabled, the Windows Process Activation Service (WAS) will encounter a failure starting worker processes to service the application pool.
At this point you should check your system event log. It may be that the password set by the account running the SecurityTokenServiceApplicationPool is invalid, or the account is disabled. If you don't use a service account, it's also possible that the password has expired.
Or refer to the solution in the article: The Security Token Service is not available
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.