Take the mattress and box spring off of the bed frame. Place them in an area where they won’t be in the way while you’re working.
Tip the bed frame onto its side so that you can reach the casters. Grasp the caster to be replaced by the wheel and pull it straight out from its socket. If the caster won’t come out easily, use a hammer to carefully tap it outward.
Place the tip of the new caster’s stem against the socket and push the stem inward. Tap the caster in with a hammer if you can’t push it all the way in by hand.
Repeat the process on as many of the casters as you need to replace. Once you are finished, put the bed frame back into its normal position and place the mattress and box spring back onto it.