If you swap the IDs in the App Store and iTunes, you will lose access to all previous purchases. Purchases are tied to the Apple ID. If you swap the IDs other places, you will lose access to some of your data. You can use the below to make the swap, but instead of deleting the ID, you need to keep the ID so you can set up Family Sharing with the ID you want to make the primary ID. That will allow you access to your previous purchases.
When changing to the new ID, there may be some data loss, but you can minimize it. If syncing photos with iCloud, ensure Optimization is turned off in Settings/Your Name/iCloud/Photos and/or in Photos/Preferences/iCloud. Then make sure full resolution photos are on the device/computer. When signing out of iCloud, if asked whether you want to retain data, choose yes. Messages conversations will be lost if they are addressed to the ID. See the article below for other places that the old ID should be removed. See Winston Churchill's response in the below discussion. Also set up Family Sharing to keep access to your apps/purchases.
How to switch Apple IDs on your iPhone or iPad. https://www.imore.com/how-change-apple-id-your-iphone-or-ipad
How to transfer all files from one iCloud account to another. https://discussions.apple.com/thread/7452747
What to do after you change your Apple ID or password - Apple Support. https://support.apple.com/en-us/HT204071
Family Sharing. https://support.apple.com/en-us/HT201060
Family Sharing - Set up. https://support.apple.com/en-us/HT201088