Check category outside loop

There are few forum posts, but I can’t seem to get what I want.
As title says, I’m trying to check if post displayed is in certain category to add something at the bottom of that single page. Code I’m trying looks like this: