Well, there are different reasons why a coffee can taste bitter.
The two main ones are the over roasting of that coffee, or its over exctraction.
What is over roasting? Basically, in the roasting process, sometimes you go too far, and the beans become dark and oily, and the fruitiness of the beans often disappear giving space to the bitterness.
When we talk about over extraction, instead, we talk about something wrong that happens at the time of extraction.
Espresso, pour over, filter... every coffee can be extracted too much for different reasons (grinding size too fine, extaction time too long, etc...): in this case even a perfectly roasted coffee can become bitter and unpleasnt.