on your last legs/on its last legs
Meaning:If you say you’re on your last legs,it can mean you’re close to exhaustion,or it can mean your close to death, if a thing is on its last legs, it’s close to breaking or wearing out.
For example: Bobby looks like he’s on his last legs. Do you think he can make it to the top of the mountain?
For Example: My old printer is on its last legs.It’s time i got a new one