Press and hold the B button.
Holding rather than tapping is the part people miss. A quick press will not register, so keep it down until the interaction completes and the contents are yours.