You can substitute pecans for the walnuts in a brownie recipe, but many people mistakenly say “substitute with” instead, perhaps influenced by the related expression “replace with.” It’s always “substitute for.”