Jennifer Garner credits Reese Witherspoon for helping her through a 'very public, very hard moment'