Check the full filename and CS2 folder. Then run a one-line console test to prove the file loads.
What happens when you run the file?
Choose the result you actually see. The first check is different for each one.
Four checks, in order
Back up the file first. Change one thing per test so the result is clear.
In Windows File Explorer, select View → Show → File name extensions. The full name must be autoexec.cfg, not autoexec.cfg.txt.
In Steam, open Counter-Strike 2 → Properties → Installed Files → Browse. Then open game → csgo → cfg.
Add the line echo "Walker Bex: autoexec loaded" to your backed-up file. Save it, then type exec autoexec in the developer console.
If manual exec works but startup does not, check for -autoconfig in Steam launch options. Test +exec autoexec.cfg only if needed. If the file loads but a setting fails, isolate that command.
What the test actually proves
The console message separates a file-loading problem from a command problem. If you see the message, do not delete the whole file just because one setting is wrong.
Keep your backup
Restore your original after testing, or remove only the test line. Avoid pasting an entire old CS:GO config into CS2.
Quick questions
The most common points of confusion.
Why does the file look correct but still fail?
Windows may hide the final .txt extension. Turn on file name extensions and inspect the complete filename.
Do I need +exec autoexec.cfg?
First prove that the file runs manually. If it does but does not load at startup, try the launch option and remove it if it changes nothing.
Should I rewrite my config?
No. If the test message appears, the file loads. Test the command that fails instead.