The first step is removal. You take the original photo and produce a transparent PNG with the subject isolated. This is what Remova does in about twenty seconds.
The second step is compositing. You take the transparent PNG and place it over the new background. This can happen inside the same tool if it has an editor, or in any design tool like Figma, Canva, Photoshop, or GIMP.
The background can be a solid colour, a gradient, a pattern, a photograph, or a scene generated by AI. The cutout does not care. It just needs a new surface to sit on.