To launch a successful shooting attack requires a degree of preparation as most weapons take a long time to load or aim. As a result, a model that wishes to make a shooting attack must have had a relatively uneventful Movement phase. The most common reasons a model cannot shoot are:
They marched in the preceding Movement phase –weapons will have been shouldered and ammunition secured while the unit advanced.
They rallied or declared a charge.
They're fighting in close combat (and therefore for their lives).
They're fleeing – such models are far more interested in saving their skins than firing their weapons.
The model is under the influence of a specific spell or special rule that prevents it from making a shooting attack.
This is, of course, not a comprehensive list. Other situations will doubtless arise, due to spell effects, army special rules and other factors. These will be explained by the relevant rule as and when they occur.