Creating a pre-recorded lecture
OBS Studio fills your description.
It is not the easiest program to use, but you can find plenty of tutorials on YouTube.
While rewinding the recording again might seem appealing, it is very common to find out more errors after you complete the recording. In that case, you need a better video editor. OBS studio might be enough, but shotcut is your best bet.