Greedy algorithm for vertex cover
Start with a clique on the vertices $A,B,C,D$.
Connect $A,B$ to a new vertex $a$.
Connect $B,C$ to a new vertex $c$.
Connect $a,c$ to a new vertex $b$.
The vertex $b$ is the only one of degree 2, so your algorithm will start by adding $a,c$ to the vertex cover. The remaining graph consists of the clique $A,B,C,D$ and the isolated vertex $b$, so the algorithm will add 3 more vertices, ending up with a vertex cover of size 5.
In contrast, the 4 vertices $A,B,C,b$ cover all edges.