Ultrafast spin dynamics is the study of the evolution of spin degrees of freedom on a time scale from picoseconds to attoseconds after being excited by an external field. With the development of laser technology, ultrafast spin dynamics has presented new opportunities for realizing ultrafast spintronic devices since 1996. However, despite decades of development, many aspects of femtosecond magnetism remain unclear. Understanding the parameters of these ultrafast spin dynamics processes requires experiments on an even faster timescale. Attosecond magnetism and the interaction of attosecond laser pulses with magnetic materials can reveal spin dynamics on a sub-femtosecond to attosecond time scale. In this review, we first introduce the significant research progress, including the mechanisms of ultrafast demagnetization, all-optical switching, ultrafast spin currents, and terahertz waves. Secondly, we analyze the problems in ultrafast spin dynamics, such as the unclear physical mechanisms of ultrafast demagnetization, the uncertain relationship between magnetic damping and ultrafast demagnetization time, and the unexplored anisotropic ultrafast demagnetization. Thirdly, we discuss the opportunities and challenges in attosecond magnetism. Finally, we analyze and discuss the future development and prospects of ultrafast spin dynamics.