Johnson believed the Tenure of Office Act was unconstitutional and wanted it to be legally tried in the courts. It was the President, himself, however, who was brought to trial. The House of Representatives voted impeachment and the Senate tried the case. The trial lasted from March to May, 1868.
Similarly one may ask, how did Andrew Johnson break the law?
On February 24, 1868, President Johnson was impeached by the House of Representatives. The House charged Johnson with violating the Tenure of Office Act. The alleged violation stemmed from Johnson’s decision to remove Secretary of War Edwin Stanton, a prominent Radical Republican leftover from the Lincoln Cabinet.