Bought Bitcoin low and high costs in 2021

I'm wondering when I sell the bitcoin - is it first bitcoin bought and first bitcoin sold? Or is it rounded to one average and you would pay taxes on that?