How to make player look behind and back to front

I am using Input Actions to control player movement. I wanted to make the player rotate/look back fast and smoothly when a key is pressed and hold and then goes back to front/normal rotation when the key is released like many other game mechanics. I have created this script [in screenshot] and it didn’t work, please help me.

screenshot :
Pasteboard - Uploaded Image (all same)
https://ibb.co/Gk58RHY
3e1231 — Postimages

What does “it didn’t work” mean?