The way flagging works is that users click the 'flag' link that appears after the timestamp underneath a story title. A user needs a small amount of karma (31 or more) before such links appear. Flags have a number of effects, one of which is to downweight a story so that it is more likely to fall in rank. If there are enough flags on a story, the software will eventually kill it (close it to new comments and hide it from users except those with 'showdead' set to 'yes' in their profile).
The purpose of flagging is to indicate that a story does not belong on HN. Frivolous flagging—e.g. flagging a story that's clearly on-topic by the site guidelines just because one personally dislikes it—eventually gets an account's flagging privileges taken away. But there's a new 'hide' link for people to click if they'd just like not to see a story.
Flagging of comments is important, too. If you see a comment that breaks the HN guidelines, such as by being uncivil, you should flag it. But there's one extra hoop to jump through in the comment case: you have to click on the comment's timestamp to go to its page, then click 'flag' at the top. That's a speed bump to dampen impulsive flagging.