Hi, please check the image below.

I want to build this robot arm using arduino and I know there ARE THOUSAND projects online about this. BUT NONE, REALLY NONE, talk about how to keep the last bar horizontal without using a servo at that very last bar cause almost all robot arm does not use a servo to keep the last bar horizontal!
You see in the image I attached that the green and blue bars are gonna be controlled using 2 servos, spinning the bars in precise angles. My problem is this: what kind of mechanism or bar linkage can I use in order to always keep the last bar (red) horizontal so my pencil will always get vertical?
I know I could use a servo in this very last bar (red) and spin it in order to keep the red bar horizontal BUT I saw many 3D robot arm in the internet that uses some kind of mechanism to keep the last bar always horizontal, no matter the angle of the other 2 bars.
Check this image ->

Also check this image:

You can see the last bar is always horizontal and those projects are not using a servo to keep it horizontal. What type of mechanism or bar size of relation or bar linkage rule that I need to follow in order to my keep my last bar horizontal?