Option 1: Don’t post a screenshot including sensitive information
Option 2: Put black boxes over them and save the image in a format that doesn’t preserve layers. I use png or jpeg. I don’t know if there are formats that preserve the history of individual pixels (accidentally or on purpose) but that is what I do.
I use GIMP, select the area with sensitive info, delete it, then fill the empty area with some solid color. No new layers created. I’m not 100% sure the info is ‘lost’ though with this method, but it seems like it is?