You have to make sure that your devices all support Bluetooth 4.0. If you have an older Mac, this could be the problem. It actually doesn’t even have to be that much older, the iMac and MacBook Pro only got Bluetooth 4.0 support in 2012, and the Mac Pro got it in late 2013.
Assuming your devices are compatible, it’s a simple process, but it seems a lot of people are having problem with it:
1. Cycle Bluetooth off and on with all of your devices.
2. Log out of iCloud on all your devices and log back in.
Apparently, there are some issues with Handoff and iCloud. You might have to perform step 2 a few times to get everything all synced up, so if it doesn’t work at first try the iCloud log out/log on again.