How can I ask to an existing category?

If you want to check whether a certain post has a certain category, you need in_category, so your test would need to be:

if (in_category($category_name))