I am installing a whirlpool dishwasher in my house. I am going to hardwire it. The wires coming from the dishwasher are a black and white 16 gauge. the wire coming out of my wall contain a black and white 12 gauge wire as well as a ground. how do i attach the two? can i just use a wire nut? does it matter that the gauge are different sizes?
First and foremost follow the instructions included with your dishwasher. It will specify the electrical service required (probably 120V 15A circuit) and will have diagrams on how to make the connections. If you don't have the manual they are commonly available online. Find the model number on the side of the door or door frame.
Connect black to black (hot) and white to white (neutral) wires with an appropriate listed connector (e.g., wire nuts). These connections will sit inside a fire-retardant (usually metal) box built into the base of the dishwasher.
Inside that box you should also see a green or bare Cu wire attached to the box itself or some other means of bonding to the metal frame of the dishwasher (such as a clip or screw). Connect the grounding wire from your circuit to the metal frame here. This is an important safety feature to avoid an electrocution hazard. If you don't see how to make this grounding connection ask a more handy neighbor or hire a handyman to do it.
I am not a big fan of hardwiring dishwashers for a few reasons. First is the need of a serviceman needing to disconnect the electrical power to work on it once he has pulled the unit. How does this meet the line of site disconnect of power rules?
Second you must keep all conductor splices in an approved enclosure. So just installing wirenuts to join them together and laying them on the floor or sticking back into the wall just doesn't cover code wiring practices and procedure. So the only practical way to hardwire the unit is to pull the romex up into the makeup box in on the dishwasher and connect it up there. That still leaves a lot of questions concerning approved uses of romex and a safe disconnecting means and the definitions of portable and fixed appliances.
Hope this helps.
The connections can be done safely with wire nuts. Bigger circuit cables are dimensioned to hold the maximum power given by the circuit fuse, dishwasher cable is sized only to bear the 'real' load of the appliance and thinner cord is enough. I suggest you, if you don't have it already, to install a GFCI protection for this circuit: water + power = possible ground-fault.