If it is in the barrel of the weapon then using a metal thin line or something small but agile that can fit through the barrel to push the BB back into the loading chamber(or reverse) should work. Make sure the magazine is out so that the BB just falls right out. If it gets stuck at the back of the barrel and is unable to fit through the loading chambers transfer hole I would then recommend either deconstructing the gun so that you can get at the BB or bring it so a store that can repair it. If the BB is stuck in the magazine because you loaded it improperly, your best bet is take apart the magazine to get at the misplaced BBs unless the magazine in this case has a released lever so that the BBs can simply drop out of the magazine.