When painting a room, you have to cover the large surfaces -- the walls and ceiling -- and the small, finicky ones -- the door and window trim. Some pros like to paint the walls first, while others prefer to start with the trim. Both ways have advantages, and how you approach it is really up to you.
Starting With the Trim
The main advantage with painting the trim first is that you'll be able to do it faster if you don't have to worry about getting paint on the walls. You can also do a better job, because you can make the long, straight strokes necessary for smooth, complete coverage without worrying about spatters. The disadvantages are that masking woodwork in preparation for painting the walls can be troublesome, and you have to wait at least a day for the paint to dry you can do it.
Masking Vs. Freehand
If you have a good-enough eye and steady-enough hand to paint without masking tape, it's still a good idea to start with the trim, because getting clean edges is easier when cutting in walls than when painting trim. If you rely on masking or painter's tape to get a clean edge, you may prefer to paint the walls first, because they are easier to tape than woodwork. Keep in mind that wall paint has more of a tendency to stick to tape than trim paint, though, and you may need touch-ups after removing the tape.