Let's imagine a solar system with at least two rocky planets. One is Earth sized "A" (or smaller) and the second is a Super Giant "B".
Both are in the habitable zone of their sun. A is closer to the sun.
On planet A, life develops. The mass of B attracts most celestial bodies and avoid them to crash on A.
As time passes by the mass of B is getting greater and greater. Either it's starting to capture more gas (and might become an unstable Gas Giant) , or either its mass starts to have an impact on A's orbit.
In any case, the people living on A, a very developed intelligence, fear of a gravitational kick out of the system due to B's mass/change of orbit (if it becomes unstable due to the gas, I'm not sure what might be the best explanation yet).
Therefore the people of Planet A decide to do something before their planet gets kicked and life destroyed. As Planet B is still important for their survival (since it attracts celestial bodies), and they can't just leave their planet and find "a new one", they go to planet B, with the intention to reduce its mass.
Given that a civilization has the technology and means to do so (unobtainium is okay in that scenario), can the mass of a Super Giant be reduced and how so ?
The idea is to have the people of A on planet B, for a long time, doing some sort of "terra forming" but in order to stop the increase of B's mass. Can they add more water ? Hollow the planet ? Change its core ?
Note that it is also important that life ends up developing on planet B and the people of A do not want to kill life on planet B but still be able to reduce the mass of the planet at the same time. (I also hope I am not mistaking "mass" with "density")