This should be self-evident. Every time you introduce a new argument or piece of information, ask yourself: how does this relate to the question? If the question has two parts, make sure you give equal weight to each component in your answer.

If you have been advised that your essays lose focus, consider ways in which you can address this before you begin writing. Are you the kind of writer who needs to actually write to get the ideas flowing? If so, consider this your first draft and then re-read with the question in front of you and make sure you have maintained focus before you redraft. Try placing the question at the centre of a mindmap and plan the essay sections around this, or do the same with a bullet point list if linear development suits you better. Reading your essays aloud can also help identify areas of repetition or digression.