This research provides numerical exploration of the dynamic stability, microstructural, elastic, magneto-electronic, and optical properties of CoYFeAl, CoYMnAl, and CoYCrAl compounds with 3d and 4d elements of quaternary Heusler compounds via first-principles computations. According to the findings, these compounds are mechanically and dynamically stable in type (I) structure and ferromagnetic phase, and they are hard materials based on their computed elastic, cohesive, and formation energies. Our investigation highlights the structural properties, which are in good agreement with other numerical simulations. The electronic properties show that the CoYMnAl and CoYCrAl compounds have half-metal behavior, supported by high Curie temperatures and integer total magnetic moments equal to 4 mu B and 3 mu B, respectively. For the third compound, CoYFeAl, a metallic ferromagnetic character is predicted for this material with a total magnetic moment close to zero. The magnetism of the compounds CoYMnAl and CoYCrAl is mostly due to the cobalt, manganese, and chromium atoms' 3d electrons. The CoYMnAl and CoYCrAl compounds exhibit narrow indirect semiconductor band gaps in the Gamma-L\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Gamma - L$$\end{document} line of 0.741 eV and 0.746 eV, respectively. A small half-metallic gap equal to 0.373 eV and 0.558 eV has been found, respectively, for CoYMnAl and CoYCrAl, indicating that these compounds could be promising candidates for spintronic applications. This numerical exploration is the first of its kind in terms of optical properties. Our findings have revealed that the CoYMnAl and CoYCrAl compounds exhibit strong absorption and can be used in future optoelectronic applications through a wide energy range of the light spectrum. In the absence of experimental data and the limited availability of theoretical investigations, the present exploration can pave the way for future studies into the potential use of these compounds in modern electronics, optoelectronics, spintronics, and conversion and harvesting energy applications intended for socioeconomic needs.