I think you can achieve what you need with one line of Linq
. Something like this.
List<(string name, int id)> names = new() { ("A", 0), ("B", 1),
("C", 2), ("D", 3), ("E", 4) };
List<string> ids = new() { "B", "D", "A" };
var filteredList = names.Where(n=>ids.Contains(n.name)).ToList();