Say I have 3 ore, 2 wheat, and a wood, and player B has a wheat, a wool, and a brick. Player B puts the robber next to one of my settlements and has to take one resource at random. Player B wants to get my wood so they can build a settlement, and I actually want them to take the wood so I can upgrade one of my settlements to the city. If they had to take a resource at random, they might get something else that would be sub-optimal for both of us. If I could just give them the wood, it would be to both of our advantages.
Is the resource taken with the robber required to be random? If they want a specific resource and I want to give them that resource, can we just do that instead of player B having to pick randomly, possibly resulting in a situation that would hurt both of us, me by losing some I needed and them by not getting what they wanted?