How can I select file names from a folder according to a list?

Plenty of info available online for this. Here’s the first one from a Google search.

Hopefully, that will get you on your way, but there are plenty of other guides out there to help you do this and it is HUGELY valuable to be able to do so.

If you really want to get a good handle on this, I would recommend reading or listening to the podcasts for Taming the Terminal.

https://ttt.bartificer.net/book.html