The first thing that you want to do is make sure that the jamb at the top of the door is level then make sure the side jambs are square to the top jamb. This is very important if you are trying to install trim in an older door frame. If the door frame is out of alignment you can use shims to correct it if it is not square or is not level. You can hold up the trim to the door and mark it to make sure that any adjustments you make with the shim will be covered.
Measure the trim to fit the top jamb of the door and use the miter to cut a perfect 45-degree angle on both sides. With the door jambs leveled and squared using shims, this should work out just fine. Drill pilot holes into the molding slightly smaller than 4d finishing nails. A 1/16 inch drilling bit should work fine. If this is not done cracking of the trim may happen when you try to nail the trim up. Use the 4d finishing nails for the trim and if you are nailing the trim into a wall stud use 6d finishing nails. DO NOT drive the nails flush with the molding until all the pieces are up and aligned just in case you have to take them back out and reposition the molding.
Repeat the procedure for the trim along the side jambs carefully measuring and mitering 45-degree angles. If the pieces do not match up perfectly flush then adjust by sanding the edges of the mitered edges until it becomes flush. Use a sanding block to ensure a straight sanding job. 120 grit sandpaper should do the job nicely, if not go with something one step coarser. Once this is done use the 4d finishing nails for the trim and the 6d finishing nails that go into the studs drilling pilot holes beforehand.
Once everything appears flush go ahead and finish driving in the nails flush and paint or stain as necessary.
Things you may need: