Before I consider painting, I first remove flash and mold lines on the mini from when it was cast during production. I use an exacto knife to remove the bulk of it, followed by small metal files (that I got from my local comic book store) to smooth any lines/rough spots out.
After removing flash and mold lines, I then use a tooth brush (that has never been used for brushing teeth) and a couple drops of a mild dish soap to remove any oils or debris from the mini. The mini is then allowed to fully dry, typically overnight, before priming.
When I prime a mini, I prefer to use spray primer instead of a brush on primer, as it is much faster. I typically prime in white, or black, depending on the color scheme I plan to use on the mini. Heroes are often done in white as they typically have brighter, bolder colors used on them, while monsters are done in black due to the darker color schemes. Occasionally I will use a grey spray primer, or even a brush on primer if needed. The brush on primer is great for touching up spots that may have been missed or spots where the primer may have flaked off. Allow the mini to completely dry before beginning to add your base color(s).
My current favorite spray primer brand for plastic minis is Army Painter. I have had the best luck with it for not flaking off of the minis. For metal minis I will use the same spray primer as I do on plastic ones, but also have had fairly good results with Board to Pieces spray primer or even Rust-oleum Professional Primer spray primer from the local home improvement store. I do caution that if you buy spray primers from your local home improvement store to make sure it says that it adheres to the material your minis are made of and to test it on a mini or two you don’t care too much about before using it on all of your minis. The brush on primers I have on hand are Army Painters in a few colors which seem to adhere fairly well to both plastic and metal minis.