As far as selling it goes, you should go to Settings > General > Reset > Erase all content and settings. It’s been a while since I’ve done it, but iirc, that will prompt you to disable Find My, sign out of iCloud and then wipe your iPhone to its factory state. There will be nothing of yours left on the device at all.
As for your other question, It wouldn’t work completely, purchases and such are linked to a single iCloud account, those you cannot transfer at all (which is why I still have to use two separate iCloud accounts, thanks to the days of Mobile Me, but I digress).
Some things, such as contacts can retain a copy of your data when you sign out of iCloud - it will ask you if you want to keep a copy on the phone, though it’s the basic essentials. Those you can transfer over to another account, when you sign in with the new iCloud account, it will ask you if you wish to merge the information on the phone with the new account.
Files stored in iCloud would need to be manually transferred over from a second device which is either still signed into your existing iCloud account, or have a hard copy of everything to move over manually.
.. Yup, it’s a kerfuffle, but it’s all part of the security of these accounts, so no nefarious characters can just swipe all of your data from you.
But you’ll forever be tied to the account you currently use for the AppStore, Apple Music and anything else you’ve ever purchased. You could get around it by enabling family sharing, so you have access to your purchases between accounts.
Or you can go down the route some of us didn’t get any other choice for. One account for iCloud and your existing account for the AppStore and such. There’s an option when you’re setting up your devices to sign in with the two separate accounts, or, you can do it manually in the Settings app.