How to make my character restart the scene when it hits the SIDE of a platform?

Im making a simple 2D side scrolling game. It will have 3 different levels (scenes)
I was just wondering how I could make it so that the scene restarts when my player hits the SIDE of a platform. (kind of like geometry dash).

I have a box collider on the feet of my character which is used to detect the platform.

How can i make it so that it restarts the scene when my character hits the SIDE of a platform (a platform that is raised higher than the ground)

I was thinking that i could add another collider to the front of my character? what would the code be for that to work?

You could have a trigger attached to your character, positioned at the edge and near the head of the model you’re using. You’d then give all platforms a tag and have a script on the character.

void OnTriggerEnter(Collider other) {
   if ( other.tag == "platform") {
     //code to restart scene
   }
}