Hello
Thank you for your question and reaching out.
Go to GPO settings \ User Configuration \ Administrative Templates \ Windows Components \ Windows Explorer. Then double-click Prevent access to drives from My Computer under Settings on the right side.
Choose Enable, and then from the drop-down menu under Options, you can either restrict just one drive, a group of drives, or all drives.
If all drives are restricted, they cannot use a flash drive to access a CD or DVD drive or to get files from it.
--If the reply is helpful, please Upvote and Accept as answer--