Hueso vs. corazón

In Spanish, the words 'hueso' and 'corazón' can both refer to elements within the fruit, specifically the hard parts inside. However, they have different meanings and are used in different contexts.

Hueso

'Hueso' primarily refers to the hard inner part of fruits, commonly known as the pit or stone. It is the hard, inedible part around which the edible parts of some fruits are formed.
El durazno tiene un hueso grande en el centro.
(The peach has a large pit in the center.)
Quité el hueso de la cereza antes de comerla.
(I removed the cherry stone before eating it.)
Las aceitunas verdes son más fáciles de comer si les quitas el hueso.
(Green olives are easier to eat if you remove the pit.)

Corazón

'Corazón' refers to the core or heart of something and can be used metaphorically. In the context of fruits, it often refers to the central, seed-containing part of certain fruits, especially when that part is not as hard as a 'hueso' but still distinct from the fleshier, edible parts.
El corazón de la manzana contiene las semillas.
(The core of the apple contains the seeds.)
Corté la piña dejando fuera el corazón porque es muy duro.
(I cut the pineapple leaving out the core because it's very tough.)
Al preparar peras, siempre remuevo el corazón con un descorazonador.
(When preparing pears, I always remove the core with a corer.)

Summary

'Hueso' and 'corazón' both refer to the central part of the fruit, but are used differently. 'Hueso' is used for the hard pits or stones found in some fruits, such as peaches and cherries, while 'corazón' refers more broadly to the pit, which may contain seeds but is not necessarily as hard as a hueso.