The best way to prevent the new paint smell is by working in a well-ventilated environment and not allowing the odour to build up in a confined space. Open windows, use a pedestal fan for cross breeze and consider low-odour paints like Dulux UltraAir.
Newly painted surfaces will continue to smell until the coating is fully cured, so allow the room sufficient time to air-out after you have finished the painting project. - MitchellMc
If oil-based paint has been used (for example gloss on door frames and architraves) then you have my sympathies. It can take a long time to dissipate. Really the best way is to have doors and windows open for as long as possible. Anything else is just trying to mask the smell. - Isobel
My Mum filling bowls with white vinegar and leaving them around the house to get rid of that new paint smell. A quick Google of this method tells me she wasn't completely insane as there are a few resources stating that it's an effective way to absorb the smell. - Jackson
Other things you could try are sprinkling Baking Soda on carpets, or put a couple of teaspoons of lemon juice on a cloth and drape it in front of a fan. - Andy_Mann