First, you’ve got to cast the Expertise, of course. If it has any targets, choose them at this time. Bear in mind that if all targets become illegal before the Expertise resolves, the whole spell fizzles, and you won’t get a free cast of anything!
Your Expertise resolved? Good. Time to do its first effect. After that effect is fully performed, but before state-based actions are checked, you’ll have the chance to choose a card to free cast. You can set up some pretty nifty combos this way, such as:
-Cast Sram’s Expertise, make Servo tokens, then cast Tezzeret’s Touch to enchant one of your freshly made tokens.
-Cast Baral’s Expertise to return one of your own permanents to your hand, or Rishkar’s Expertise to draw cards, then immediately (re)cast one of the cards you just added to your hand.
-Cast Yahenni’s Expertise or Kari Zev’s Expertise. Use your free cast on Altar’s Reap, sacrificing one of your creatures which would die anyway or the creature you just stole.
The free cast spell will go on the stack above the Expertise. Then, the Expertise has fully resolved, and is put into the graveyard. At this time, you’ll check state-based actions, anything that triggered will go on the stack above your free spell, and assuming everyone passes priority, your free spell will resolve and do its effects (or enter the battlefield if it’s a permanent).