I would sand the bottom of the pocket so that it is smoother, but not too smooth. It’s end grain, which is hard to get really smooth and the end grain has lots of open pores which give the glue something to really hold on to, so you’ll get a very strong bond.
I’d glue the shim in first, as it will be a lot easier to place it accurately. Being wedge-shaped, it can be squeezed backwards when clamped with wet glue on the top and bottom, as the glue is quite slippery until it dries to the tacky stage. Doing it in two stages, with a clamping block very slightly smaller than the shim, you can see the forward edge of the shim and make sure it goes on in the right place. I’d leave the shim sticking out very slightly over the front of the pocket so that you can sand it back flush once dry. Much easier to do that than try and line it up perfectly flat and end up with it sitting back slightly leaving a gap that will need filling.