How do i fix "Script does not exist" error when trying to add my script to something

Hello everyone
as you may already know why you are here about my question,
i am having an error saying something like “cant add script to component"item name” because this script does not exist, please make sure title and script are matching" or something along those lines
i have tried everything and looked everywhere for the answer so i thought i might ask on the questions page.
Thank you for anyone who can help me and you will be credited in the game i am making if you pm me your name/company.
Thank you for taking the time to read this and hopefully help me out

Try make a copy away from Unity of your script, delete the script in Unity and re-import and try add it to your component.

The file and class names must be the same for Unity to recognize the script. Check that the file in project screen and the class name inside the script are exactly the same, even lower and upper case letters.

Do you have any complier errors on your script? If so, Unity probably won’t let you attach it to anything. This happens to me all the time.