How to use "stupidity" in a sentence

Sentences

'It gave me so much happiness just to look at her, and now, through my stupidity, I've lost even that.'

I realized the stupidity of the small hope I had held on to for so long