There is no easy manual way to arrange things in Chests. Instead, Chests have an "Organize" button on the R side on PC/Mac, Switch, and mobile, which uses it's own repeatable arrangement so once you get used to the way it organizes, it does work reasonably well. The button looks like white rectangles piled on top of each other. Try it out!
I think the same button may also work that way for the Backpack, but you can manually move things around in Backpacks so you can already do what you want in there.