This graph is not connected because there is no path between vertices in the left pair and vertices in the right pair. The graph, however, contains two connected components: $\{1,2\}$ and $\{3,4\}$. Miriam Briskman, CC BY-NC 4.0.
\documentclass[border=1pt]{standalone}
\usepackage{tikz}
\tikzset{
vertex/.style={draw, circle, very thick, minimum size=1cm},
edge/.style={very thick}
}
\begin{document}
\begin{tikzpicture}
% Component 1
\node[vertex] (1) at (0,0) {$1$};
\node[vertex] (2) at (2,0) {$2$};
\draw[edge] (1) -- (2);
% Component 2
\node[vertex] (3) at (6,0) {$3$};
\node[vertex] (4) at (8,0) {$4$};
\draw[edge] (3) -- (4);
\end{tikzpicture}
\end{document}