This article concentrates in analyzing optimal controls for stochastic integrodifferential equation (SIDE) in Hilbert space. Necessary parameters are imposed to demonstrate the system that follows a unique variation of parameter formula using Leray Schauder Alternative. Subsequently, the existence of optimal control is investigated for the considered Lagrange control problem. The theoretical example with the mechanical example of ethanol fuelled engine are discussed to validate the results obtained.