I'm going to use "vectors" (which are just pairs of numbers in this case, which I'll write in brackets), which can be added to points termwise, so that
$$
(1, 2) + [3, 5] = (4, 7)
$$
Vectors can also be multiplied by numbers, termwise, so that
$$
\frac{1}{2}[3, 5] = [3/2, 5/2].
$$
You can think of vectors as representing, in the plane, movement in some direction, so that $[3, 5]$ means "move 3 units to the right, 5 units up," and when you do so, it makes a lot of sense to add a vector to a point: you take the point (which was $(1, 2)$ in my example) and move it $3$ units right and $5$ units up, and you end up at $(4, 7)$. When you multiply a vector by $\frac{1}{2}$, you make the displacement half as big, and so on.
One last thing: I wrote
$$
(1, 2) + [3, 5] = (4, 7)
$$
so show how to add a vector to a point, but we can do some algebra (moving the $(1,2)$ to the right hand side) and write
$$
[3, 5] = (4, 7) - (1, 2),
$$
and now you've got a really nice thing: the "difference" of two points is a vector. In fact, if you have points $P$ and $Q$, then $v = Q - P$ is exactly the vector that moves $P$ to $Q$ (which we often draw as an arrow pointing from $P$ to $Q$).
Here's a really useful fact: if you have a vector $[a, b]$, and at least one of $a$ and $b$ is nonzero, then the vector
$$
[-b, a]
$$
is perpendicular to $[a, b]$, and is rotated 90 degrees counterclockwise from $[a, b]$.
The other useful fact is that if you have a vector $[a, b]$ of some length, then
$$
\frac{1}{\sqrt{a^2+b^2} [a, b]
$$
is a vector pointing in the same direction, but with length $1$. (A length-1 vector is called "unit vector" sometimes.)
OK, with all that in mind, let's return to your problem. First, let's let
$$
w = B - A
$$
That's the vector that moves $A$ to $B$, or an arrow from $A$ pointing towards $B$. To make this concrete, I'm going to pick
$$
A = (1, 4)\\
B = (5, 6)
$$
So now
$$
w = B - A = (5, 6) - (1, 5) = [4, 1]
$$
for our example. We can produce a unit vector in the same direction as $w$ by the trick mentioned above: we multiply by $1$ over a square root. If $w = (a, b)$, we compute
$$
v = \frac{1}{\sqrt{a^2 + b^2}} [a, b].
$$
In our example, this comes out to
$$
v = \frac{1}{\sqrt{4^2 + 1^2}}[4, 1] = [\frac{4}{\sqrt{17}}, \frac{1}{\sqrt{17}}].
$$
If we then use the first trick -- swap the two entries and negate the first, we get
$$
v^\perp = [-\frac{1}{\sqrt{17}}, \frac{4}{\sqrt{17}}]
$$
which is an arrow of length $1$ pointing perpendicular to the line from $A$ to $B$.
In the general case, we get
$$
v^\perp = \frac{1}{\sqrt{a^2 + b^2}} [-b, a].
$$
If we multiply this by $d$ and add it to the point $A$, we get the point $A'$:
$$
A' = A + d v^\perp.
$$
In our example, picking $d = 2$, that gives us
\begin{align}
A'
&= (1, 4) + 2[-\frac{1}{\sqrt{17}}, \frac{4}{\sqrt{17}} ]\\
&= (1, 4) + [-\frac{2}{\sqrt{17}}, \frac{8}{\sqrt{17}} ]\\
&= (1-\frac{2}{\sqrt{17}}, 4 + \frac{8}{\sqrt{17}}).
\end{align}
This works perfectly as long as the vector $w$ isn't $[0,0]$ (which we need to make the "perpendicular" vector). But this just means "as long as the points $A$ and $B$ are different", which is obviously necessary -- if they're the same, the question doesn't really make sense.