This paper provides a unified formulation of optimal guidance-to-collision law for a target with an arbitrary acceleration or deceleration. The collision course for general target acceleration or deceleration is first determined from the engagement geometry in conjunction with the nonlinear engagement kinematics in the proposed approach. The heading error defined in the collision course is then adopted as a variable to be nullified for accomplishing the intercept condition. The proposed guidance law is derived based on the heading error dynamics and the optimal error dynamics to ensure optimality and finite-time convergence. As illustrative examples, the proposed guidance command for a constant target acceleration and a target deceleration in the form of a quadratic function of speed are provided. Additionally, the time-to-go prediction method is suggested for implementing the proposed method. The characteristics of the proposed guidance command are analytically investigated to provide insight into the proposed method. The key benefits of the proposed method lie in not producing unnecessary guidance commands near a target compared to other methods and ensuring optimality in guidance command even in the nonlinear engagement kinematics. Finally, numerical simulations are performed to validate the proposed method and to show our findings.