Measure the depth and the height of the dishwasher and add 2 inches to the depth measurement and 1/2 inch to the height measurement. Cut out two 1-inch thick plywood boards that match these measurements. Consider these boards the side boards of the cabinet.
Measure the width of the dishwasher and add 1/2 inch to this measurement. Cut out two 1-inch-thick plywood boards that are this distance by the other depth measurement. Consider these the top and bottom boards of the cabinet.
Have an assistant hold the side boards upright on what will be their front edge, parallel to each other. Place the top and bottom boards against either of their ends so that the four boards form a rectangular frame.
Set 2-inch metal L-brackets within the frame, spaced every six inches between each joint. Attach the brackets with 3/4-inch wood screws.
Measure the dimensions of this frame from outside edge to outside edge, both side board to side board and top board to bottom board. Cut out a 1-inch thick plywood board with these dimensions and set it on the ground. Lower the rectangular frame onto this board. Set 2-inch metal L-brackets against this board, which is the rear board and against the frame boards, spaced every 12 inches. Attach the brackets with 3/4-inch wood screws.
Measure the interior distance between the top board and the bottom board. Cut three 2-by-4 sections to this distance. Hold the dishwasher up to the cabinet and determine three locations where these boards could be pressed up against the rear board of the cabinet without covering up the water tubes from the dishwasher.
Hold these 2-by-4s in position with their large surfaces against the rear board and drill 3-inch wood screws through the back board and into each 2-by-4, spacing the screws every 12 inches.
Drill two 3-inch wood screws through the top and bottom boards and into each end of the 2-by-4s.
Set a countertop section that matches the kitchen on top of the cabinet. Drill up through the inside of the cabinet and into the countertop, spaced every 12 inches in a grid. Attach the countertop to the cabinet with 1 1/2-inch wood screws.
Position the dishwasher in the cabinet and mark any holes that need to be drilled out to allow access for the tubes and wires. Place these holes on the least noticeable surface of the cabinet depending on placement, usually the rear board. Put the dishwasher within the cabinet and set it in its final position.