Use a Sharp Saw Blade
Try out the table saw miter sled in the video below to get started.
Tweak the Cut
Glue and Sand for a Seamless Fit
Here's a trick to make miters look great, but it only works if you're installing raw trim that will get finished after installation. Apply a thin layer of wood glue to the end grain of each piece before you assemble them. Use a damp (not wet) cloth to remove excess glue from the joint. Sand over the miter with a small piece of 120-grit sandpaper. Sand across the joint and finish up by carefully sanding out any cross-grain sanding marks by moving the paper with the grain from both directions.The sawdust from sanding will mix with the glue to fill any small gaps. Sanding the miter will also even out any slight level differences and make the job look more professional.