In general, as the rishonim learn from Shabbat 74a–b, you may only select from a mixture under three conditions: (1) you remove the food from the waste, and not vice versa; (2) you remove the food by hand; (3) you remove it for immediate eating. When any of these conditions are missing, a penalty of karet is at stake. Each condition is very detailed, and I don't plan to cover them here.
One of the major questions with borer is how far its application goes. What kinds of mixed items are included in the prohibition? Just waste from food? Or even forks from knives?
At one extreme, there is the Talmud Yerushalmi, Shabbat 7:2, which quotes Rabbi Yudan's limited view of borer:
אמר רבי יודן יש שהוא בורר צרורות כל היום ואינו מתחייב יש שהוא נוטל כגרוגרת ומיד מתחייב היך עבידה היה יושב על גבי כרי וברר צרורות כל היום אינו מתחייב נטל לתוך ידו כגרוגרת ובירר חייב
It sounds like the only way to transgress borer is to clear the very last stone from a pile of grain. You have to entirely purify the food from its waste. Unlike what happened with zoreh, this is a case where you'd be happy for the Rema to pick up the Yerushalmi, at least if you like kulot.
At the other extreme, we have the “great question” of Rabbi Yehiel Michel Epstein, in Arukh ha-Shulkhan, O"H 319:8. He assumes that borer applies to literally “everything,” even a collection of non-food items. Were it indeed so, he objects, “we could not find our hands and feet!”