\(D=2021-\sqrt{\left(x-3\right)^2+1}\le2021-\sqrt{1}=2020\\ D_{max}=2020\left(C\right)\)
\(D=2021-\sqrt{x^2-6x+10}\)
\(\sqrt{x^2-6x+10}=\sqrt{\left(x^2-6x+9\right)+1}=\sqrt{\left(x-3\right)^2+1}\ge\sqrt{0+1}=1\)
\(\Rightarrow D=2021-\sqrt{x^2-6x+10}\le2021-1=2020\)
\(maxD=2020\Leftrightarrow x=3\)