Combat system

I want to create a combat system for my game like these two https://youtu.be/ShJP0oyrJrg and https://youtu.be/FW5YNMdJruY
​​​​​​but I can’t figure it out
Does anyone know a tutorial that can help me?
Help is really appreciated