Push button single serial write

Please help me with this Arduino Uno push button code. By using this code when I press push button it print output continually.
But what I exactly want it when I press button (No matter its long press or single press ) it always print or serial.write only one time.

Declare a Boolean variable and set it to false. Test the variable before you print and print only if it is false. When you print set the variable to true.

Please help me with this

Not a snowball's chance in hell. If you can't bother posting text AS TEXT, you can look for help somewhere else.