All modern monitors support the EDID specification. EDID-capable monitors report their capabilities to your computer.
All modern X driver modules support DDC, the VESA Display Data Channel facility. A DDC-enabled graphics-card module will ask the monitor to hand it an EDID capability description and configure itself from that data. So with any recent monitor, you are likely not to have to do any configuration at all.
If your graphics-card module happens not to be DDC-enabled but your monitor speaks EDID, you can still use the read-edid program to ask the monitor for its statistics and compute a mode line for you. See the read-edid home page.
A manual modeline generator lives here. You can either download the Python script or use the CGI form provided.
X provides a tool called xvidtune which you will probably find quite useful for testing and tuning monitor modes. It begins with a gruesome warning about the possible consequences of mistakes with it. If you pay careful attention to this document and learn what is behind the pretty numbers in xvidtune's boxes, you will become able to use xvidtune effectively and with confidence.
If you have xvidtune(1), you'll be able to test new modes on the fly, without modifying your X configuration files or even rebooting your X server. Otherwise, X allows you to hot-key between different modes defined in Xconfig (see X.man for details). Use this capabilty to save yourself hassles! When you want to test a new mode, give it a unique mode label and add it to the end of your hot-key list. Leave a known-good mode as the default to fall back on if the test mode doesn't work.
Towards the end of this document, we include a `modeplot' script that you can use to produce an analog graph of available modes. This is not directly helpful for generating modelines, but it may help you better understand the relationships that define them.