First you need an iCloud account. Then sign in to it in the System/iCloud preference pane and check the items you want to be able to synce:
What library are you referring to? iPhoto or iTunes? One can't upload an iPhoto library to iCloud. iCloud only stores the last 1000 photos taken by an iPhone or iPad or imported into an iPhoto library and only for 30 days.
Here's more on setting up iCloud: Apple - iCloud - Learn how to set up iCloud on all your devices.