Roasting
During roasting, many chemical reactions occur, the content of organic acids in green grains changes. The darker the coffee is roasted, the more bitter it will be. It is because chlorogenic acid is destroyed during the heat treatment and forms more bitter acid. And during the Maillard reaction, bitter melanoidins are formed, giving the coffee a brown color.
Brewing method
Many factors affect coffee extraction: brewing method, grind size, water temperature, and brewing time. There are general recommendations on how not to make too bitter coffee.
The smaller the grind size, the longer the coffee will be extracted and the more flavor will be extracted. A beverage may over-extract, resulting in a bitter taste.
The higher the water temperature, the more efficiently the flavor compounds will be extracted. If the coffee turned out bitter, you can reduce the temperature of the water by a few degrees.
However, remember that if you change one of the settings, it may affect others. Therefore, for each variety and method of preparation, you need to select your own recipe in order to get a balanced coffee taste.