How to avoid or track phone usage overnight I have an unrooted Samsung Galaxy s10 that I need to find a way of keeping myself from using overnight or at least track what I do.

The problem here is that I sleepwalk on a fairly regular basis, I have ended up at the bus stop a few times, made breakfast, just generally some pretty scary things. My fear is that at some point during the night I will turn on my phone and text someone or something similar (eg. snapchat someone or something) and I would like a way of making that impossible, or at least know if that does happen. My current procedure is pulling up my activity logs from every social media site I'm on and going through my phone log, but this isn't ideal as A) it takes a really long time and b) theres still a chance that I sent a text and then deleted it, therefore making it invisible from my end. Is there anyway that I can set a mandatory shut down time on my phone, like tell it to not let me turn it on until a certain time the next day or something like that? Or even better is there a way of tracking my activity? In my research it didnt seem possible to generate a log of when i power my phone on or off, but maybe theres another way of going about this.

Also worth noting, I have tried puzzle lock type things in the past (like where I have to solve a math problem to unlock my phone) but apperantly my subconscious is just as good as I am at problem solving so that wont work.
Ok so I answered my own question, I found this app: https://play.google.com/store/apps/details?id=com.hash.ar.systemlog that generates a readable log of every event that happens on the phone. This, partnered with the app mentioned in a comment by @Natsu Kage achieves both things that I hoped to achieve