In order to solve this question quickly we need two recall two concepts.
1. If $\lambda$ is an eigenvalue of $A$ then $\lambda^k$ is an eigenvalue of $A^k$.
2. The sum of all eigenvalue of $A$ is equals to the trace of $A$.
Let $A$ be the given $2\times 2$ matrix. Let $\lambda_1$ and $\lambda_2$ be two eigenvalues of $A$. Note that the given matrix is a upper triangular matrix. So its eigenvalues are nothing but its diagonal entries. Therefore,
$$\lambda_1 =1 \qquad\text{and}\qquad \lambda_2=i$$
Therefore, the eigenvalues of $A^k$ are
$$\lambda_1^k =1 \qquad\text{and}\qquad \lambda_2^k=i^k$$
Note that $trace(A^{2018})=a+d$, that is sum of the eigenvalue of $A^{2018}$. It follows
$$a+d = trace(A^{2018}) = \lambda_1^{2018}+\lambda_2^{2018} =1+i^{2018}=1-1=0.$$
Therefore, the correct option is (B).