This paper aims to investigate the possibility of generating exact solutions for appropriate anisotropic spherically symmetric systems in gravity where and are non-metricity and the trace of the energy-momentum tensor respectively. These solutions involve embedding a spherically symmetric static metric into a five-dimensional pseudo-Euclidean space. To solve Einstein's field equations and ensure that the solution is free of center singularities, a physically plausible selection of the metric coefficient is used. With the help of the Karmarkar condition, we compute the component of the metric tensor using the metric coefficient . At the boundary of the compact star, we match interior spacetime with the exterior spacetime to find the values of unknown constants. To make the solution match the measured mass and radius, we have tuned up the solution for compact star PSRJ1614-220. The behavior of the solution has been thoroughly examined for the same star. By examining the necessary physical characteristics, such as energy conditions, causality condition, hydrostatic equilibrium, pressure-density ratio, Herera Cracking criterion, etc., the physical acceptability of the model in the context of has been investigated. It is observed that the present solution allows viable modeling of stellar objects in gravity.