Hi there,
Navigate to User Configuration \ Administrative Templates \ Windows Components \ Windows Explorer. Then on the right side under Setting, double click on Prevent access to drives from My Computer.
Select Enable then under Options from the drop-down menu you can restrict a certain drive, a combination of drives, or restrict them all.
Restricting all drives means they can’t access the CD or DVD drive, and cannot use a flash drive if they need to get files from it.
--If the reply is helpful, please Upvote and Accept it as an answer--