I've seen the following claim in some lectures notes which let me think that I might have a major misunderstanding:
The claim is that if $M$ is an embedded submanifold of $\mathbb R^d$ with boundary of codimension $1$ and $f$ and $V$ are differentiable scalar and vector fields, respectively, then $$\operatorname{div}fV=f\operatorname{div}V+\frac{\partial f}{\partial\nu}\langle V,\nu\rangle+\langle\nabla f,V_{\partial M}\tag1,$$ where $$\frac{\partial f}{\partial\nu}:=\langle\nabla f,\nu\rangle,$$ $\nu$ is the normal field and $V_{\partial M}$ is the tangential component of $V$ (i.e. the projection of $V$ onto the tangent space).
I don't understand why it is important that $M$ has codimension $1$. If $M$ is $k$-dimensional, then $\partial M$ is $(k-1)$-dimensional. If $M$ has codimension $1$, then it is $(d-1)$-dimensional and hence $\partial M$ is $(d-2)$-dimensional .... Why should this be of any use in $(1)$?
Assuming $M$ is $k$-dimensional, $(1)$ should trivially follow from $$\operatorname{div}(fV)(x)=\langle\nabla f(x),V(x)\rangle+f(x)\operatorname{div}V(x)\;\;\;\text{for all }x\in\mathbb R^k$$ and $$\langle\nabla f(x),V(x)\rangle=\langle\nabla f(x),\operatorname P_{T_x(\partial M)}V(x)\rangle+\langle V(x),\nu(x)\rangle\frac{\partial f}{\partial\nu}(x)\tag2$$ for all $x\in\partial M$, where $\operatorname P_{T_x(\partial M)}$ denotes the orthogonal projection of $\mathbb R^k$ onto the tangent space $T_x(\partial M)$ of $\partial M$ at $x\in\partial M$.