When I did a course in topology, we defined "homotopy" in the following way:
"A homotopy between two continuous functions $f$ and $g$ from a topological space $X$ to a topological space $Y$ is defined to be a continuous function $H : X \times [0,1] \rightarrow Y$ from the product of the space $X$ with the unit interval $[0,1]$ to $Y$ such that, if $x \in X$ then $H(x,0) = f(x)$ and $H(x,1) = g(x)$. Two continuous functions are said to be homotopic if there exists a homotopy between them."
However, when I studied category theory, we defined it as follows:
"Let $A$ be an additive category and $\text{Ch}(A)$ the category of chain complexes of $A$. Let $X^{\cdot}$ and $Y^{\cdot}$ be two objects of $\text{Ch}(A)$, denoted by $$\cdots \overset{d_x^{n-2}}{\longrightarrow} X^{n-1}\overset{d_x^{n-1}}{\longrightarrow} X^n\overset{d_x^n}\longrightarrow X^{n+1}\overset{d_x^{n+1}}{\longrightarrow}\cdots $$ and $$\cdots \overset{d_y^{n-2}}{\longrightarrow} Y^{n-1}\overset{d_y^{n-1}}{\longrightarrow} Y^n\overset{d_y^n}\longrightarrow Y^{n+1}\overset{d_y^{n+1}}{\longrightarrow}\cdots $$ respectively. We say that a morphism $f\in\text{Hom}_{\text{Ch}(A)}(X^{\cdot},Y^{\cdot})$ is homotopic to zero if for every $n\in\mathbb{N}$ there exists a morphism $s^n:X^n\rightarrow Y^{n-1}$ such that $f^n=s^{n+1}\circ d_x^n+d_y^{n-1}\circ s^{n}$. The morphisms $s^n$ are called homotopies, and two morphisms $f$ and $g$ are said to be homotopic if $f-g$ is homotopic to zero."
I know there is a relation between them, but I can not see it. Of course the second definition does not make sense in topological spaces, but we could apply both definitions in the category of topological abelian groups.