you need a headset removal tool to knock the cups out of the frame.
the tool costs about £20 or cheaper but if you wanted and had the time and ability, you can make on yourself using a steel pipe. just cuts 4 slots down the length of the pipe at one end then splay the ends out.
to refit you’ll need a bearing press tool, buying them can eb costly but again you can make a homemade one. all you need is a long threaded shaft with bolts, some big steel washers and possibly a piece of hardwood witha hole drilled into it so the threaded shaft can pass through it.
its similar to installing a headset.
I bought the Park tools BBT-90.3 set for about forty quid, which comes with the removal tool and a pair of cup presses for fitting. Need to add a headset press to tighten the cups, or like I did get some threaded rod and nuts & washers from the hardware store for a couple of quid…
You may be lucky if the cups just pop out, but mine have always been a tight fit and knocking them out destroys them, even though I install them with grease and use the proper removal tool.
Also be careful just using washers to press the cups in rather than the proper cup presses, as the inner bearing race is slightly raised, so all the force will go on the bearings. The proper Park tools have a raised lip which presses on the cup surround instead…