This study investigates a cosmological model driven by nonlinear electrodynamics (NLE) with a varying gravitational constant $G$ . The aim is to explore the current accelerated evolution of the universe influenced by a magnetic field within this NLE-driven framework. A homogeneous and isotropic cosmological model with flat spatial sections is considered. NLE fields with varying $G$ are treated as the source of gravitation. Model parameters are constrained using the Cosmic chronometer data and Pantheon sample of SNeIa data with Markov Chain Monte Carlo (MCMC) techniques. The classical stability of the model is assessed. The model’s parameters are constrained to the best-fit values. The behavior of the deceleration parameter, equation of state, energy density, and pressure is analyzed. Various cosmological diagnostic tools, including the Om diagnostic and energy-condition analysis, are employed to examine the properties of the dark energy component and the dynamical evolution of the Universe. The varying gravitational constant is found to have very small values at the present cosmic time.