The following statement is stated in Nicolae Dinculeanu, Integration on Locally Compact Spaces without proof:
Suppose that $T$ is a locally compact Hausdorff space and $E$ is a Banach space. Given a compact set $K\subseteq T$ and a continuous function $f:K\rightarrow E$, $f$ can be extended to a continuous function $f_{1}:T\rightarrow E$ with compact support.
If $E$ is the real line, then it is classic, and the proof can be found in Gerald B. Folland, Real Analysis, but now $E$ is a Banach space, the situation is much more complicated.
@pre-kidney has provided a link addressing the issue. But I do not think that answers my question because $T$ is locally compact.
Perhaps someone can point me a standard reference for that statement.