In this article, we perform a detailed theoretical analysis of new exact solutions with anisotropic fluid distribution of matter for compact objects subject to hydrostatic equilibrium. We present a family solution to the Einstein-Maxwell equations describing a spherically symmetric, static distribution of a fluid with pressure anisotropy. We implement an embedding class one condition to obtain a relation between the metric functions. We generalize the properties of a spherical star with hydrostatic equilibrium using the generalised Tolman-Oppenheimer-Volkoff (TOV) equation. We match the interior solution to an exterior Reissner-Nordström one, and study the energy conditions, speed of sound, and mass-radius relation of the star. We also show that the obtained solutions are compatible with observational data for the compact object Her X-1. Regarding our results, the physical behaviour of the present model may serve for the modeling of ultra compact objects.