Working with physicists I can only tell how to not do it: Just stop talking, waiting a moment in awkward silence and then something like “ok, see you” and walk away…
Edit: The hardcore guys just make indefinable noises instead of saying “ok, see you”