How would I create a pulley system?

So, I’m wondering how I would make a pulley system that could do stuff like this


and if a part moves to the left, the other part would move to the right.