Kitchen wall units, whether they're cabinets, cupboards or open shelves, need to be level and plumb (meaning straight up and down) if you don't want things sliding off the shelves. In older homes, the walls often aren't plumb, and sometimes aren't even flat, so properly fitting a wall unit can be a challenge. Even light, decorative wall units always should be attached directly to the studs behind the wall, never in unsupported plaster or drywall.
Measure the back dimensions of the wall unit. Mark the dimension on the wall where you want to hang it. Use your level to make sure the lines are level.
Mark the wall studs that run behind the area where the unit will be, using your stud finder. Put the stud marks above and below the marked out area for the unit, so they will be visible to you when the unit is on the wall.
Measure to find the location of each stud relative to one edge of the marked-out area. Transfer the measurements to the back of the unit. Sink pilot holes along the lines on the back of the unit, one near the top and one near the bottom of each marked stud.
Lift and hold the unit to the wall, in the marked-out area. Shoot mounting screws with washers into each pilot hole, making sure they grip the studs behind the wall.
Hold the level vertically along the front of the cabinet to check for plumb. Loosen the top or bottom screws in the unit as necessary to shim behind it, moving the top or bottom out from the wall as needed to ensure it's all straight up and down.