Does it reboot like this when you run OctoPrint in safe mode? If so, then it's possible that one of your plugins is causing this.
How are you powering the 4B? It wants 5V @ 3A as I recall and an official power adapter rather than trying to pull power sideways over a USB cable from something else. So, no chargers.
Does it reboot like this if the touchscreen isn't connected?
Does the touchscreen have its own power connection and power adapter?
If so, is the Pi being power from a courtesy USB connector on that?
Im using the official Raspberry Pi 7" touchdisplay, the screen is powered from the Pi,
The Power adaptor is Official Raspberry Pi adaptor aswell.
About octoprint in safe mode im not sure how to do that, im new at this stuff, how do i know if it reboots if i dont have the screen connected.... its on the screen i see that it reboots, i can logg in to octoprint from the computer without problem and im running my 3D printer from the computer without problem, the few seconds its booted up i can also use OctoScreen before it reboots again.
Try it again having removed the serial cable to the printer board.
Also, it's not rebooting. If it were actually rebooting then you'd see a long list of Raspbian commands upon bootup (maybe two minutes) and then finally you'd see the screen come up. Notice that it comes right back and still knows that the 39% is there.
If it were me, I would remote into the Pi using ssh and then try to figure out what's going on with your x session. You might try cat ~/.xsession-errors to see if there's anything there. Or you might have to do something like watch ls ~/.x* to see if the size of that file changes. What's sad is that by the time your x session crashes, it immediately restarts which then overwrites the previous one.
Maybe instead then... tail -f /var/log/syslog and watch to look for anything to suggest that your x session is cycling (which it is).