Pour the heavy cream into the bowl of a stand mixer fitted with the whisk attachment (or use a large mixing bowl with a hand mixer).
Begin whipping the cream on medium speed until it thickens into whipped cream, about 3 to 4 minutes.
Continue whipping past the whipped cream stage. The cream will begin to clump and separate into butter and buttermilk. This usually happens around 8 to 10 minutes in total.
Once the butter and buttermilk fully separate, stop the mixer. Pour the contents through a fine mesh strainer or cheesecloth set over a medium bowl to catch the buttermilk. Save the buttermilk for baking if desired.
Transfer the butter to a clean bowl and press it with a wooden spoon or silicone spatula to remove as much excess buttermilk as possible. This step is important; any leftover buttermilk can cause the butter to spoil quickly.
Rinse the butter under cold running water or in a bowl of ice water, kneading it gently with your hands or spatula to wash out the last bits of buttermilk. Continue rinsing until the water runs clear.
For salted butter, sprinkle kosher salt over the butter and knead it in evenly.
Pack the butter into a clean jar or container with a tight lid. Store in the refrigerator for up to 1 week, or freeze for longer storage.