Adding in_category() content

I am trying to display content on a product’s page based on the category of that product but it’s not working. Below is the code I am using. Please help.

<?php
if ( in_category( 'Category Name' ) ) {
echo special content
}
?>