The complex phase diagram of the Fe(Se,S) system poses new challenges to understanding the relationship of the nematic phase, spin fluctuations and orderings, and superconductivity in this system and other iron-based superconductors. Combining density functional theory and dynamical mean field theory , we carry out a comprehensive first-principles study of the crystal structures, electronic structures, topological properties, and spin dynamics of stoichiometric FeSe and FeS and doped . optimized crystal structures of FeSe and FeS agree very well with experimental results and significantly improve DFT predictions. We find that at and 0.25, is topologically nontrivial and has topological Dirac surface states on the (001) surface. The system undergoes a topological phase transition between and 0.5 and becomes a topologically trivial compound at 0.5. Meanwhile, with increasing S doping from to 1, both the electronic correlation strength, measured by the mass enhancement of Fe electrons, and the low-energy spin fluctuations are suppressed monotonically. Moreover, when there is negligible nematicity at 0.25, the evolution of the fluctuating total spin of the Fe electrons exhibits the same trend as the experimentally determined superconducting transition temperature with increasing S doping. It can be concluded that both electronic correlation and spin fluctuations play important roles in the superconductivity of Fe(Se,S), whereas nematicity is detrimental to superconductivity.