Discrete-time optimal control problems are a crucial type of control problems that deal with a dynamic system evolving in discrete time-steps. This paper introduces a new technique for solving linear discrete-time optimal control problems with state delays, applicable to both finite and infinite time horizons. Our method employs a Riccati matrix equation, optimizing control strategies and ensuring system stability through bounded control inputs. We adopt a Bolza problem for the performance index, which guides the classification of control issues. The technique simplifies problems into manageable Riccati matrix equations using the Euler–Lagrange equations and Pontryagin maximum principle, ensuring stability and necessary condition compliance. The paper validates the approach with numerical examples from quantum mechanics and classical physics, demonstrating its practicality and potential for broader application.