Mr. Harward’s career has closely tracked that of Mr. Mattis, from the time the two worked together in Afghanistan after the Sept. 11 terrorist attacks of 2001 to his tour at Central Command from 2011 to 2013, which included an assignment heading detainee operations in Kabul.