If you are weak in the endgame, you must spend more time analysing studies; in your training games you must aim at transposing to endgames, which will help you to acquire the requisite experience.