How to extract items with specified values from tree data?

Please don’t duplicate posts. Thanks