How to query term_id of a Custom Taxonomy by name

You can use the get_term_by function. This allows you to obtain a term (from a given taxonomy) by its slug or name (or id). The returned term object contains the term’s ID.

For example:

$term =get_term_by( 'name', 'December-12', 'Birthday');
$term_id = $term->term_id;

If ‘December-12’ is the slug, rather than the name, of the term, simply replace ‘name’ with ‘slug’.