Prevent? Proper dental techniques reduces the chance of post operative discomfort following the placement of composite fillings, but even with that, sometimes there is some sensitivity or discomfort. You can't really prevent it. However, if it does occur, see your dentist to see if the bite needs adjusting or the tooth needs further treatment.
Minimal. Pain should be minimal and handled nicely with OTC meds.