The seven-time champion confirmed last month that talks were underway with the Silver Arrows over a multi-year extension that would keep Hamilton in the sport into his 40s.
That could put a stop to Ricciardo's plans to re-enter F1 after a sabbatical, with the outgoing McLaren driver leaving the grid at the end of the year.
The Australian has been linked to a Mercedes reserve role for next season, with team principal Toto Wolff refusing to rule out the potential switch.
“For us, we very much like him, he’s a great character, but we are not in a position to decide who’s going to be the third driver," said Wolff.
But asked if the news of Hamilton's contract talks threatened his ability to return to the grid, Ricciardo replied: "The truth is I want him to stay in the sport,"
"He's one of the greatest ever to do it and I think competing with him, going wheel to wheel with him is fun, it's awesome, it's normally at the pointy end so I certainly wish to do that more in the future and that's where it currently lies.
"So I think my future will be, let's say, I don't think it's relative to what others do.
"Opportunities will arise when they do, but I'm not banking on anyone doing something so I can find my way.
"I want to take the time necessary, let's say, keep a little bit of distance to the sport and rebuild myself, but then yeah, if something makes sense in ‘24, come back with a vengeance and have some fun and hopefully race at the front."