Always use a 2.5-3 inch high quality paintbrush. A larger brush holds more paint, which means fewer times dipping and refilling, which leads to fewer mistakes. To paint properly it takes some practice, especially for cut ins. A cut in requires moving your brush from outside of a line you want to create to the actual line you wish to make, such as a wall to ceiling edge, or a wall to window edge. Look at the line you want to make in your mind first, don't fixate on the brush, then begin to cut the corner with a smooth rotation movement of your wrist. Adapt to the straightness of the line quickly and continue.
Again, this takes some practice, but if you cut a little sooner than you should, so as to not get paint on the unwanted area, you will begin to understand how the brush feels and moves. All makes and models of brushes mixed with different types of paint will react, or flow differently. The wrist movement and your eyes on the wall or surface area your painting is paramount for good results. Always keep a rag close by for mistakes. Even pros mess up more than they are willing to admit.