Open system preferences , click on internet accounts , select the iCloud account and click on subtract sign a pop window appears do you want to keep a copy of your iCloud data on this Mac before signing out ? Two options will be shown ( a ) cancel ( b ) keep a copy , so click on keep a copy .
The boxes iCloud Drive , contacts , calendars , reminders are checked by default - so click on keep a copy .Immediately click on stop updating and continue , a pop up window will appear are you sure you want to stop updating and continue with sign out ( any documents not updated to iCloud Drive , will be moved to a folder named “ iCloud Drive archive in your home folder on this Mac ) so don’t click on “ cancel “ but " click on continue with sign out .”
A pop up window will appear . Do you want to keep a copy of safari passwords on this Mac ?
( 1 ) Delete from Mac ( 2 ) cancel ( 3 ) keep on Mac .So its optional you can select keep on Mac or click on delete from Mac ( as some users write down the safari passwords in a safe place and they can autofill it again . )
It will prompt enter the Apple ID password the Apple ID address will be already written in the field , so enter your Apple ID password and click on next , a small circle will rotate , be patient .
In the internet account side bar the iCloud account will be inactive , after a while a pop up window appears do you want to merge , contacts , calendars , reminders and safari with iCloud , so click on merge .
Again after a short while a pop up window appears enter your Apple ID and password so enter the password and click on ok .
A pop up window appears to set up iCloud Keychain on this Mac , request approval from one of your other devices , using iCloud Keychain .
( a ) use code ( b ) cancel ( c ) request approval so click on use code .
Enter your six digit iCloud keychain code and click on next a sms will come to the trusted mobile number , enter your iCloud verification code that appeared in the mobile on a pop up window appeared again on the Mac and click on ok .
The keychain box will get checked , after some time option button will appear in front of it , wait for few minutes , check the box of Siri , also the box of iCloud Drive is checked , click on option button in front of it and check the box of desktops and documents it will show setting up ( a small circle will rotate ) and click on done .
Click on option button in front of keychain box your trusted country code and trusted mobile number is written .
Note : you have to be very patient when the boxes are checked , and it will take time as the apps process are running in the background .
You don’t need to sign with Apple ID and password in the location of system preferences and then click on iCloud .