The conventional wisdom is to pack the rucksack with the heavier objects close to the body and higher up in the sack to reduce leverage on the shoulders.
However this also has to be balanced against the need for accessibility of food clothing and equipment and the order in which they will be needed during and at the end of the walking day.
When carrying several days supply of food I load the bulk of the food into the bottom of the rucksack but keep the days lunch and snacks separate for loading later. Next I load my sleeping bag loose in a waterproof plastic bag. ( I don’t use a compression sack because that reduces the efficiency of the sleeping bag and I always use a waterproof bag because no rucksack is rainproof). Then the tarp or tent against the back of the rucksack with spare clothing in waterproof bags packed around them. On top of this is the cookpot and stove padded around with rainproof shell and fleece top hat and gloves and the days snacks and lunch. Also near the top a small bag with footcare items and any other meds or first aid. Fuel and water bottles go into side pockets. Sleeping mats I tend to carry strapped to the side or top of my pack as they are great to quickly throw down for rest or nap.