An amplitude analysis of the $B^+\to D_s^+ D_s^- K^+$ decay is carried out to study for the first time its intermediate resonant contributions, using proton-proton collision data collected with the LHCb detector at centre-of-mass energies of 7, 8 and 13 TeV. A near-threshold peaking structure, referred to as $X(3960)$, is observed in the $D_s^+ D_s^-$ invariant-mass spectrum with significance greater than 12 standard deviations. The mass, width and the quantum numbers of the structure are measured to be $3956\pm5\pm10$ MeV, $43\pm13\pm8$ MeV and $J^{PC}=0^{++}$, respectively, where the first uncertainties are statistical and the second systematic. The properties of the new structure are consistent with recent theoretical predictions for a state composed of $c\bar{c}s\bar{s}$ quarks. Evidence for an additional structure is found around 4140 MeV in the $D_s^+ D_s^-$ invariant mass, which might be caused either by a new resonance with the $0^{++}$ assignment or by a $J/\psi \phi\leftrightarrow D_s^+ D_s^-$ coupled-channel effect.