Repairing a bed is not a very common handyman repair. Beds are personal and people generally don’t want a handyman with dirty hands going near them except when they are ready to collapse.
Most of the issues lie with where the horizontal mattress support rails meet the legs. There is often a poor connection here and it leads to a good amount of wobble.
If the bed is metal, there will me two bolts and washers at each leg. I’m guessing these are loose. Go to each leg and tighten everything up. It is a 10 minute job and that will likely make the bed much more solid.
If the bed is wood, things get a little trickier. The horizontal mattress support has two downward-facing hooks that stick out of each end that mate with each leg. The leg pieces have a mortised area and a metal face that supports the weight of the mattress as the hooks rest upon them. These are usually very solid because of the way they are designed. If they are loose, you will need to disassemble the bed to get access to these parts. Each male and female part is mortised and screwed into the end of the rail and the side of the leg. Once you have them apart, see what became loose. It may be a matter of simply tightening the screws or using slightly larger screws.