What you need to do is cut a red apple for the outer part, add a second whole apple on the inside as seen in the picture, then combine and bake them in an oven until they look golden.
Alternatively, you could get lucky with Apple Seeds. To do this either put down your apples so that it looks like one apple and hit ctrl+a so that many apples will grow out of it or if you have already planted your seeds just wait near a tree until they grow into an apple. After this is done pick your seed up and plant them on dirt or sand blocks one by one (make sure all parts are touching) and wait for them to grow into trees. Then after they turn red chop off the leaves and bark so that all you have left is the apples. Now combine them in a crafting window to get your golden apple!