Well, I know how to build a trading machine, but now my question was, for example, how can I ask for 1 stack item for 1 single item?
You mean by redstone? You would have to build a sorting system and an item counter and link them to the output, there should be tutorials on YouTube.