Get a book (or two) on Route 66, read up on it, and decide just how much and what parts of it you want to try to see. As noted much of it no longer exist. And what does exist for the most part exist in short stretches scattered across the states noted above.
But Yellowstone and Tetons are a LONG way from 66. You would probably do best by getting one out of the way first and then finish up with the other rather than trying to detour off 66 and then try to return to it.
You could drift north and pick up 66 in Missouri, follow it westward as far as you want, then start a return trip to the north to get Yellowstone, Tetons, and other destinations in that part of the US as you made your way back home. Hopefully you are planning on an extended length trip to see all that.