Draw a diagram, label variables.
Write a formula for the thing you are trying to optimise eg in your first problem it is area, in your second it is surface area).
Use any given information to get your formula in terms of one variable only.
Then you sound like you know what to do....which is a good thing!
Start with the second one first (it's actually a bit easier).
Draw a diagram of a square based prism. label the width x, length x and height h. (or any other letters you wish)
So V = h*x^2 (you had this already - i prefer to use x)
Now you know that V = 32000 so 32000 = h*x^2 (you already knew that). This also means that h = 32000/x^2.
Now this seems to be where you get stuck.
What are you trying to optimise? Answer: Surface area
So...get a formula for surface area from your diagram (remember it has an open top) so SA = ................(at this stage this will involve both x and h).
Formula with 2 variables??? - a problem. So ...use the fact that
h = 32000/x^2 to get the formula in terms of one variable x. Then you know what to do!!