You can reference a text at first called deadText. Also make a string with value “you lose”. And also an IEnumerator (function with similar structure that void has) called time before restart (if you don’t know what to type inside IEnumerator reply and I’ll tell you)
DYING WHEN FALLEN KFF SCREEN
Now the problem is that I haven’t watched the course and I don’t know if brackeys has made a way of checking whether player has fallen off the screen or not. You could make a box colider with huge z value, check is trigger and use void OnCollisionEnter that you must be familiar with and then call the IEnumerator. I can’t come up with any other ideas sorry.
DYING WHEN HITTING AN OBSTACLE
It’s way simpler with dying when creating into object. In script that is attached to obstacle (if there is any) in void OnCollisionEnter call the IEnumerator (though this will only work if obstacles are duplicates of each-other. I believe they should be if a level is endless.)
That’s this is a solution that I came up with and I can’t guarantee that this will work. I’m an intermediate programmer myself.