There is usually a tool supplied with Di2 for disconnecting and reconnecting cables. If you’re battery is in the seat post it is a simple task on undoing the clamp bolt and, carefully, sliding out the seat post. You then disconnect the cable and remove a circlip. The battery will then fall out.
The only pain is getting the seat post back to the correct height but a bit on tape around it to mark the location helps.
Unfortunately not on all bikes. My Canyon has the ridiculous design of needing to remove BB to get at Di2 battery. Yes really!