Files and items in OneDrive can be shared in different ways like using a shareable link and through email invites. These files can at anytime be stopped from being shared.
Here is how to do it (this example uses the OneDrive Personal account):
Login to OneDrive. Then click on Shared from the left pane.
This will display a list of files that are shared so far. To stop sharing, right-click on the specific file and select Details.
The right pane will display how it is shared (there will be a link icon and an email icon if it is shared using both – link and an email invite to it).
To change these sharing options, select Manage access.
To revoke the link access, click the cross icon next to it. This is also applicable if you want to change the link from edit to view-only or vice versa. The same shared link can’t be modified to change its settings, a new link needs to be generated to do so.
(For premium OneDrive accounts, you can also change the link expiration date and password from here.)
Next, click on Remove link.
The shared file will no longer be accessible through that link.
Similarly, for email invites for file sharing, if you’ve given a contact edit access, you can choose Change to view only. To completely revoke access, select Stop Sharing.
The details section for the file will now no longer show any of the previous shareable details.
All done.