At a crafting table, place a carrot in the centre and a gold nugget in each of the eight surrounding slots to make one golden carrot. The Bedrock recipe uses gold nuggets. See Crafting for the crafting grid. Mojang recipe, Recipe table
In Bedrock, a farmer villager can sell golden carrots for emeralds. The farmer trade table selects one offer from a group containing golden carrots and glistering melon slices, so that group does not guarantee the carrot offer on every farmer. See Trading. Mojang farmer trades
Golden carrots are ingredients for making potions of Night Vision. This is a Brewing use; the food definition does not assign Night Vision when a carrot is eaten. Official carrot article, Mojang food definition
The reference releases are Java 26.3 and Bedrock 26.62. The numerical food value, farmer offer selection and detailed animal uses above are scoped to the opened Bedrock definitions; they do not establish identical Java values or trade selection. Mojang's sample files are published on the main branch rather than pinned to one release. Official release index