You attach it to a completely metal part of your case...usually when you take off the side, there's a little lip that the side of the case slides onto, just put clip it on there...just make sure like killian said you aren't clipping to a painted piece, you want to put it on a solid metal part of your case.
does that mean the computer has to be plugged in
I don't understand why you might think the computer has to be plugged in..we're trying to prevent electricity buildup with the strap and your computer should NEVER be on if you're working on it. If you simply meant the main power cable, well just to be on the safe side I always turn the PSU off AND take out the power cable and give it a couple seconds for the power to completely drain.
Turn off your comp and clip it to somewhere metal, that's it