\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[bbt/.style={draw=blue,solid,thick,fill=blue!50,circle,inner sep=2pt}]
\draw (-0.5,0) -- (5,0) (0,-0.5) -- (0,5);
\draw[dotted] (0,1) node[left]{$y_1$} -- (1,1) node[bbt,label=above:$A$] (A){} -- (1,0)
node[below]{$x_1$};
\draw[dotted] (0,4) node[left]{$y_2$} -- (4,4) node[bbt,label=above:$B$] (B){} {} -- (4,0)
node[below]{$x_2$};
\draw[purple] (A) -- (B) node[midway,above,sloped] {$d_{A,B}$};
\end{tikzpicture}
\end{document}