I took this from Google. More to show you how you can use Google as well as our Apple communities.
1. Reboot your iMac by holding down the iMac power button to shut down, then pressing again to start up.
2. While iMac is rebooting, hold the power button on the trackpad down until it flashes green (discovery mode - two short flashes, repeated).
3. Wait for iMac to finish rebooting. A minute or so later, the bluetooth set up assistant should automatically appear (your trackpad is now connected).
4. Trackpad should auto connect, enabling you to click the appropriate confirmation/agreement notices to complete the bluetooth setup assistant steps.