I get that not every criminal prepares like they're pulling off an "Ocean's Eleven"-style heist . . . but you gotta prepare a LITTLE.

There's a 47-year-old guy named Matthew Davies from Dunfermline, Scotland.  And last September, he tried to rob a bank.

Well, he was in court last week, and we found out how the robbery went wrong.

Apparently Matthew took a pillow case with him to the robbery to use as a mask.  But when he put it on . . . he realized he'd forgotten to CUT EYE HOLES.

So he had to take off the pillow case to be able to see during the robbery . . . which made it very easy to identify him.

He wound up pleading guilty to assault and robbery, and he'll be sentenced next month.