If you sign out of your Apple Account settings on Mac
Before you sell or give away your Mac, be sure to sign out of your Apple Account in System Settings on that Mac. See Sign in to or out of your Apple Account.
What happens to your iCloud data when you sign out?
When you sign out, you’re asked whether you want to keep copies on your Mac of documents stored in iCloud Drive and data stored in iCloud by Contacts, Calendar, Reminders, and Messages. If you keep copies, iCloud no longer keeps them up to date with changes on your other devices. If you choose not to keep copies, your documents and data stored in iCloud are removed from your Mac.
You’re also asked whether you want to finish downloading photos and videos that aren’t fully downloaded from iCloud Photos to your Mac, or remove the items that have been downloaded. After you sign out, downloaded photos and videos aren’t kept up to date with changes on your other devices.
Your bookmarks and Reading List remain in Safari, but the iCloud Tabs list of webpages open on your other devices is no longer available.
After signing out of your Apple Account on your Mac, you can still access your iCloud documents, data, photos, and videos on other devices where you’re signed in to your Apple Account, and on iCloud.com.
Copy iCloud documents and data before signing out
Before signing out of your Apple Account, you can selectively copy or archive iCloud documents and data to your Mac.
iCloud Drive: For instructions on copying documents to your Mac, see Store files in iCloud Drive.
Mail: For instructions, see Import or export mailboxes in Mail.
Contacts: For instructions, see Export and archive contacts in Contacts.
Calendar: For instructions, see Import or export calendars.
If you sign in to your Apple Account again on your Mac, your iCloud documents and data reappear on your Mac. Photos and videos you haven’t yet downloaded from iCloud Photos also appear on your Mac.