There is wide disagreement even among veteran painters about whether to paint woodwork, such as trim, baseboards, and wainscoting, before or after painting walls. It comes down to personal preference. The argument for painting woodwork first is that any stray drips or spatters that end up on the wall only need to be feathered out, not removed, since the wall's going to get a new coat of paint anyway. If you get all of the slow, detail work out of the way first you'll feel as if you're flying right along when it's time to fill in the big, flat areas. On the other hand, rollers always emit a powder-fine spray of paint into the room. No matter how careful you are, some of it is going to end up on the woodwork.
Whether you decide to paint the woodwork first or last, be sure to inspect it for defects, and make the necessary repairs before you actually get down to painting. If you'll be painting over already-glossy woodwork, sand it lightly with sandpaper or steel wool first to help with adhesion. Or, give it a coat of deglosser.
If you're using only one color and one finish on all surfaces, you may want to paint the trim as you come to it in the process of painting the walls. Of course, you'll have to keep alternating between brush and roller if you use this technique, but this shouldn't be difficult in rooms that have only a couple of windows and a single door. If you decide to paint the trim first, mask it off with masking tape or painter's tape when you paint the ceiling and walls.
To paint the top of a baseboard, paint down from the top for five or six short strokes, then smooth over them with a single, long, smooth stroke. Then, using a painting shield or a thin piece of cardboard as a movable masker, cut in along the floor. After that, you can fill the unpainted space between with long brush strokes. Paint only 2 or 3 feet of baseboard at a time. Examine the surface for drips, spatters, and overlapped edges, and clean them up immediately. Do not wait until the entire baseboard is painted or the paint flaws will have already set.
Painting wainscoting or paneling requires a similar approach to that of baseboards. Cut in along the top and bottom edges where the wainscoting meets the wall and the floor, just as you did with the baseboard. Next, paint the indented panels and the molding around them. Paint tends to collect in the corners of these panels, so your brush strokes should be toward the center of the panel. On the raised surfaces around and between panels, work from the top down, and use up-and-down strokes on the verticals, back-and-forth strokes on the horizontals.