What windows are you using and have you installed any mods recently?
Also, go to your Windows Defender Firewall -> Allow apps to communicate through Windows Defender Wall.
Then mark your Grand Theft Auto San Andreas as Public.
If that didn't help you then, go to GTA folder and right click as shown on the screens below.
- [+] Step by step
If you're using Windows 7, do Service Pack 2 on both.
If you're using Windows 10 then do Windows 8 on both.
Also, try downloading CLEO and Anticrasher.cs
Please post feedback after you've tried to do the following instructions.