When I’m handing my X back tomorrow presumably I just need to back it up and then wipe it, and remove it from my iCloud account and find my iPhone? Last year I kept my 7+ so could do the nice leisurely set up at home.
iCloud back up or to a computer. What ever your usually do.
They’ll probably walk you through the wiping in store but it’s the erase all content and settings option. Shouldn’t need to do anything else