Dethatching a lawn isn't all that complicated but it can be a messy process. The first thing that you need is the appropriate tools. You can dethatch by core aerating, using a thatch rake, or a vertical cutter.
Core aerating dethatches by bringing microscopic critters up to the surface of the lawn to eat the thatch. The easiest way to core aerate is to rent a machine from a home improvement store and just run it across your lawn. These machines have these metallic hollow tines which pull plugs of soil out of the lawn. This helps your soil and keeps thatch under control.
Manual Dethatching using a garden rake is a messy process. Your lawn will end up looking worse for a few days. You should use a garden rake during the most active growing season so that it doesn't look bad for too long. You need to drag your rake across the grass. Don't worry about hurting your grass, it'll look sad for a bit but it's good for it. This can take awhile if you have a big buildup of thatch. Keep raking until you've cleaned all the debris from the lawn.
Vertical cutters work on the same general principal as hand raking. With the machine it is more efficient and brutal though. A vertical cutter cuts through the grass, sod, thatch, and top layer of soil. If you don't know what you're doing you probably shouldn't learn on a vertical cutting machine. It would be safer for you and your lawn to hire someone to do it for you. If you are experienced with many different power machines you can give it a go. Just make sure that you read the directions and get your cutting blades set right.
If you tend to get a lot of thatch, you should dethatch your lawn on a regular basis. It should be one of your primary lawn care chores, yeah I know that list of chores just keeps growing.