Been asked and answered loads of times before.
Will depend on if your running ATV or vix on your box as to where in the menus you need to go.
The basics are plug it in the front leaving whatever you were using before in the back, initialise the HDD, shut down the box, unplug your old device from the back, plug the HDD in the back, restart box, check mounts to make sure its mounted as media/hdd, setup a swap file and that should be it.
Like I said without knowing what image your running I can't be more specific