How to fetch post id using the term id in WordPress

For the different type of operation, we need to filter the default loop in WordPress. Sometimes we need to get post ID from a specific term ID(tag, category). In this tutorial, I will show you how to get post ID by category/tag ID.