This command lets you drop items that will give you items you can drop to spawn a villager who will trade you a diamond for three gold ingots.
After activating the command block, click the "Get Items" sign. Then drop the diamond and the emerald on the ground together and you will receive a diamond block. Then drop the gold ingot and glass, and you will receive a minecart. Finally throw the diamond block and the minecart on the ground together, and they will spawn your villager!