It's called "mastering" and it is a science and an art all to it's own.
There are several different methods that will allow you to do it yourself, but they really are too lengthy to get into here. (some have tried; if you do a search for "mastering" you might turn some up). If you really want to understand it, you'll need
a book.
For "quick and dirty" mixes that sound "OK" in your car, a lot of people use programs like
Izotope Ozone, or
IKMultimedia TRacks, which have some good presets for that sort of thing, but for a final comercially released product, it is almost always best to have a professional mastering engineer do it in a professional mastering listening environment.