The given sentence is an advice.
In an imperative
sentence, the verb of the reported speech takes 'to' i.e. to go, to do,
etc. In the negative sentence the infinitive (to+ verb) is preceded by
'not'.
Infinitive always takes the basic form of the verb
preceded by to. So, 'don't say' will change into 'not to say'.
In an imperative sentence the reporting verb is changed into request, beg, order, advise, instruct, forbid.
Thus, in indirect speech, the sentence must be,
My lawyer advised me not to say anything to the police.
Thus option D is the correct answer.
Options A,B,C are incorrect as they do not follow the rules of Narration and Reporting.