This study investigates a specific type of fractional optimization problems, subject to a dynamical system including the Caputo–Hadamard fractional differentiation. In this way, a novel class of basis functions known as the fractional logarithmic Chebyshev cardinal functions is introduced. An operational matrix regarding the Hadamard fractional integral of these fractional functions is derived and employed to develop an efficient numerical method for the provided problem. The established algorithm converts the solution of the primary fractional optimization problem into the solution of an algebraic system of equations by representing the state and control variables via the introduced fractional functions. Two test problems are considered to confirm the effectiveness of the suggested method. The derived outcomes of solving these examples highlight the satisfactory accuracy and efficiency of the designed method.