General Tips

Use a plain background

Ideally, you want a plain white background so your screenshot is as simple as possible. To do this, open a new browser window/tab, and drag the desired window in front of it.

Show the cursor

If your screenshot is of a GUI, it's often beneficial to be able to see the appearance and position of the cursor. Not all screenshot tools can capture the cursor; if yours doesn't, you may want to switch to a different method.

File format

Whenever possible, save your image as PNG. PNG is good for images with sharp lines and offers reasonably good compression.

Image size

Bytes
When visitors load the page in a browser, they don't want to wait while a massive image downloads. RSS feed readers also load images, which can cause a significant pause while trying to scroll through a list of unread posts. The size of PNGs can be reduced by increasing the compression ratio, which can be done in some image editors or with specialized compression tools.

Dimensions
Try to make the image as small as possible while still showing the problem. Don't create a 1200x800 image if 400x300 is sufficient. Images that are too large will be scaled down by the SE software, with less than optimal results.

When to not post screenshots

Do not post images of your code.

Do not post images of your IDE showing compilation errors.

In these cases, the important part of the problem is the text, so that's what should be included. Simply copy the relevant text and paste it into the post.

How to: Windows

To capture your screen, either:

Press Print Screen.

Press AltPrint Screen to limit the screen capture to only the active window.

Paste the result into an image editor and save.

Alternatively, for Windows Vista onwards and Experience Pack for Windows XP Tablet PC Edition 2005, you can use the Snipping Tool application which allows a user to make various forms of screenshots; this often makes your job a lot easier.

How to: Unix-based

KDE

Press Print Screen, which launches ksnapshot.

When run, ksnapshot will open with a new screenshot. If necessary (for instance, if you only want a portion of the screen), repeat using other options.

Use Save As to save the image. If it needs further editing, use Copy to Clipboard and paste it into an image editor.

Gnome

You hear a camera sound and the capture appears in a dialog box. Use Save to save it to a file. If it needs further editing, use Copy to Clipboard and paste it into an image editor.

gnome-screenshot can alternatively be launched from the command-line. -h|--help describes options (delayed captures, border shadows, selecting an area with the mouse), -i|--interactive gives you a dialog box to select the options interactively.

How to: Mac

To save a screenshot to the desktop, do one of the following:

Press ⇧⌘3 to take a full-screen screenshot.

Press ⇧⌘4 to take screenshot of a selected part of the screen.

To save a screenshot to the clipboard, do one of the following:

Press ⌃⇧⌘3 to take a full-screen screenshot.

Press ⌃⇧⌘4 to take screenshot of a selected part of the screen.

Open Preview and choose File > New from Clipboard. Edit the image and save. After any key combination, press space to limit the screenshot to the frontmost window.

How to: iOS devices

Simultaneously press (and quickly release) the On/Off Sleep/Wake and Home buttons. The screenshot will be added to the Camera Roll album.

How to: Android

Rooted

There are a number of screenshot applications available for rooted Android phones, including ShootMe, Screenshot, and drocap2.

Not rooted

Some Android phones, like the Galaxy S, come with a built-in screenshot app.