It is claimed in idempotent completion nlab page that the any (co)complete category is idempotent complete. How is this true?
My guess given an idempotent $(A,e)$, $e^2=e$, we cavn define the retraction $A_e$ as the equalizer of the maps $e$ and $id$. Hence, "the image of $e$".
You define the map $i$ as the equalizer of $id_X$ and $e$. And $r$ is defined as the unique map which exists by the universal property of the equalizer:
From this $i \circ r = e$ is obvious. You can see that $r \circ i = id$ because $id_X \circ i = e \circ i$ since $i$ is an equalizer and substituting $e = i \circ r$ gives
$$ id_X \circ i = i \circ id_{Eq} = i \circ r \circ i$$
and since equalizers are monic this gives us $id_{Eq} = r \circ i$ which proves that $e$ splits.
You can dualize this argument easily to get that $r$ is the coequalizer of $id_X$ and $e$ and $i$ exists by a universal property, try it for yourself! This means that if either equalizers or coequalizers exist then every idempotent splits.