Start by defining a unit vector (positive direction) eg $\hat e $(ast) which in this case might be to the right in the diagram below and $\hat w$(est) to the left.
This is just equivalent to using the words east and west to define the directions.
$p$ and $d$ are distances between positions $A$ and $B$ and $B$ and $C$ respectively.
Assume that $\vec {AB}$ is shorthand for the displacement from position $A$ to position $B$ and that that $\vec {BA}$ is shorthand for the displacement from position $B$ to position $A$.
$\vec {AB}$ = $-\vec {BA}$, so moving from position $A$ to position $B$ and then back to position $A$ the total displacement is $\vec {AB}+\vec {BA} = \vec {AB} + (-\vec {AB}) = \vec 0$
$p$ is the magnitude of the displacement $\vec {AB}$ and also the displacement $\vec {BA}$.
$\hat e = - \hat w$
We can write $\vec {AB}= p \,\hat e$ where $p$ is the component of displacement in the $\hat e$ direction but also $\vec {AB} = p\, (-\hat w) = -p\, \hat w$.
Thus $-p$ is the component of $\vec {AB}$ in the $\hat w$ direction.
Suppose we need to find the displacement when moving from position $A$ to position $C$ and back to position $B$.
$\vec {AC} + \vec {CB}= \vec {AB} = p\, \hat e = -p\,\hat w$.
A longer method is as follows.
$\vec {AC}+\vec {CB} = (p+d)\,\hat e + d\,\hat w = p\,\hat e + d\hat e +(-d\,\hat e) = p\,\hat e$
One could also use west as the positive direction.
$\vec {AC}+\vec {CB} = (p+d)\,\hat e + d\,\hat w = (p+d)\,(-\hat w) +d\,\hat w = -p\,\hat w$