A. Try to save your progress frequently if the game allows it. Look for save options in the menu to avoid losing progress.
B. If you need to restart a level, take notes on what you did previously to avoid repeating mistakes and to streamline your progress.