How do I make an object 1 collide with only object 2?

I have to make a game which there is a monkey trying to eat only the bananas, avoiding all the other fruits. Which code should I use?

You should define tags. One for monkey and one for banana. Use onCollisionEnter read the reference on unity3d.