Make sure your network settings are perfect ,Google DNS settings as : 8.8.8.8 and 8.8.4.4 , location as automatic ( if you are not moving the system to other place ) , remember networks this computer has joined , WPA2 AES , all proxies must be unchecked .
Sometimes , due to sudden drop in wi - fi network is observed , to resolve it go to system preferences > network click on TCP/IP > again click on renew DHCP lease .
An article : OS X El Capitan: Resolve IP address conflicts
Regarding , notes or calendars , contacts are not syncing .
Open notes & its preferences ( can use command + comma to open application preferences ) , check the box of enable the on my Mac account .

You can notice if there is a server issue or server is down the rotating circle will be continue for hours , I have cross checked by opening IMAP mail account > window > connection doctor .
I have called the service provider on phone , so they say that server is down , or sometimes observed a slight cut in wires can create the problems .
And don't use any third party software , anti virus in the system .
In system preferences > iCloud > the box of back to my Mac should be always unchecked , and rest of all options should be checked .