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.
Botvinnik: 100 Selected Games (ed. Courier Corporation, 2012) - ISBN: 9780486145495