The commercial production of lead-based perovskite solar cells (PSCs) is hindered due to toxicity difficulty and all Ti-based all-inorganic PSCs may give a practical solution to these problems. This work optimizes the different layers of a PSC based on the Cs2TiI6 absorber layer. In order to produce four unique structures, ten distinct HTLs are considered to identify the best HTL, and after that four ETLs are utilized. These structures are then optimized using SCAPS 1D simulation software. The thickness of the absorber and electron transport layer (ETL), as well as the acceptor and defect density of the absorber, and the acceptor density of the hole transport layer (HTL), were optimized sequentially. After the optimization, the best PCE of 28.03 % along with VOC, JSC, and FF of 1.11 V, 28.39 mA/cm2, and 89.01 % were found, correspondingly for the structure of FTO/SnS2/Cs2TiI6/MoTe2/Au. Additionally, the effects of temperature, series resistance, and shunt resistance were investigated with regard to the four most promising devices. The generation and recombination rates, together with the reported properties of current-voltage density (J-V) and quantum efficiency (QE), are also relevant to the first and last optimized devices in the four-device investigation.