Before you put paintbrush or roller to a wall, you first want to cut-in the corners. This means painting both sides of each corner starting about two brush lengths away and painting in to the corner. Use a 2- or 3-inch brush for paints and a foam brush for glazes.
Because the drying time of flat and eggshell latex paint is so short, you can cut-in an entire room before filling in the walls. Semigloss or gloss latex and alkyd paints take much longer to dry but will leave a demarcation line if the walls are not filled in while the paint is still wet. For this reason, a room should be cut-in one corner at a time and the wall filled in before cutting in the next corner. If the same paint is being used for the wall and ceiling, you can cut-in the ceiling-to-wall connection just as you would the corners of a room. If the ceiling is being painted a different color, paint it first and then the walls.
Whether painting a floor or a ceiling, be sure to cut-in around light fixtures, outlets, windows, doors, and any other fixed items before filling in the rest of the surface with a brush or roller.