Read the manual. During normal dashcam usage, it only records in an hour loop. If you don't press the horn or press the camera icon to save the footage (what it actually does is only move it to a different folder), it will get deleted after an hour passes. However, don't press the horn or button immediately after the event you want to save. This is because there are cases where the most important files are deleted (it records in one minute increments) perhaps because it gets corrupted by the request to save them.
Model 3 Owner's Manual | Tesla
That said, not all is lost, I document how to recover footage that was deleted from the one hour loop:
Dashcam in Auto
Note footage can only be recovered if it was recorded in the first place. If your dashcam is chronically showing the "x" error, that may not be the case.