There are several steps to take to wipe your iPhone clean of your ex. Apple's Safety Check is a good first step; then you remove them from Family Sharing, delete photos, and more.