Some games or Steam.exe file uses various system files; they are not malicious but have a tendency to be malicious. So, by this, most of the Antivirus flags Steam; therefore, you should also exclude the Steam executable.
To test the integrity of your game files, after disabling real-time scanning or excluding steam files, restart your PC.

Then open up Steam, go to the library section and go to the game that you were facing the issue with—Right-click on it and hit properties. On the local files tab, click on the verify integrity of game files option.
Solution 2: Resetting Winsock
Winsock is related to an interface that uses TCP/IP protocols in various ways for Windows network software to access network services. Basically, it’s an API that plays a major role in connecting your Windows PC to the Network.
So, why should you reset Winsock if you are having issues accessing Steam files? As you know, Steam needs the Internet for various aspects. If the Winsock catalog has some issue, it will be reflected in Steam too.
There are two ways to reset Winsock. You can do it on the command prompt or in Run Dialog Box:
To open up the Run Dialog Box, press the Windows key + R on your keyboard. Once the Run Dialog box appears, in the input field, type netsh winsock reset.

Lastly, press Enter or click on the OK button to reset Winsock. After that, you can open Steam and check the game in which you were having issues accessing the files.
If you wish to reset Winsock via the command prompt, type and search CMD in the Windows Search Bar.
Using your arrow keys on the keyboard, select the command prompt from the result and run it As Administrator.

Now just type the command netsh winsock reset in the command prompt and press Enter to execute. After that, you can launch Steam, check the integrity of the game files.
Solution 3: Run Steam as Administrator
Though Steam needs numerous dependencies, which include most of the system files, thus you will need administrative privileges because you can’t access many system files without being an administrator. It is possible that the steam files locked issue you are having is due to not running Steam as an administrator.
You know how to run an application as an administrator on Windows, but it will be a pain to right-click and run Steam as an admin every time. Therefore, right-click on the steam icon and select properties.
If you have clicked on the shortcut icon, then open the file path of the steam.exe and visit the directory, there select Steam, and it’s properties.
After that, on the properties window, go to the compatibility tab. Now check the box beside the Run this program as an administrator option, click Apply button.

Then click on OK. Once done, every time you launch Steam it will open as an admin, and this should fix the issue.
Solution 4: Relocate Steam Files and Running a Disk Scan
To change the location of the Steam files and games, firstly launch the Steam Client and go to Steam settings.
There click on the Downloads option and then head over to the Steam Library Folders.
Now, click on the Add Library Folder button below, go to the new location for your Steam and game files and select it.

Once you have added the new location, you can close the steam client and open up the file explorer. Visit the steam directory in the File Explorer, the path is C:\Program Files\Steam. Here delete the .exe and other files, then move the files to the new location.
Note: don’t delete the UserData and the SteamApp folders
Lastly, launch Steam, log in, and check if the issue is resolved or not. If not, then it is possible that the disk has a bad sector. To fix it you can perform a disk scan.
Using your Windows Search bar, search CMS, and open up the Command prompt. There type the command chkdsk C: /f and execute the command.

If any of your Steam files are either corrupted or damaged, then you must check Steam logs or update Steam to fix it.
Conclusion
Solving Steam errors is quite easy and straightforward. Most of the time, the issues rely upon permission or a glitch with your antivirus program. In case the above solutions do not work for you, then try to reinstall your Steam client again. Your game data is in sync with Steam could, so you won’t lose and game data when you install the Steam client again.