To substitute something or someone means to have them take the place of another.
When I ran out of juice, I had to substitute water to drink in the morning.
Example picture