Rolling with Advantage
If the situation is slanted in your favor, the GM may grant you advantage on your roll. Other mechanics may also confer advantage on your roll. This means you roll 2d6 and take the higher die. If the die is a natural 6, explode the die; if it's a natural 1, confirm a critical.
Rolling with Disadvantage
If the situation is slanted against your favor, the GM may confer disadvantage on your roll. Other mechanics may also confer disadvantage on your roll. This means you roll 2d6 and take the lower die. When rolling with disadvantage, you have to roll two 6s in order to explode (since the lower die is the one you take). If you roll a 1 on either die, you must confirm a critical.
Net Advantage & Disadvantage
Doubled Advantage & Disadvantage
When there is a net advantage from two different sources on a roll, that means you have doubled advantage. Roll 3d6 and take the highest die. The same is true with doubled disadvantage: roll 3d6 and take the lowest die. This is roughly equivalent to a +2.
When to Confirm a Critical
Remember that when rolling with advantage or disadvantage, only one of the two dice you roll are counted toward the result (the higher or lower die); the other is ignored. So if you are rolling with advantage and you roll a 3 and a 1, you take 3 as the result and ignore the 1: you would not confirm a critical. If you are rolling with disadvantage and you roll a 6 and a 1, the lowest roll in this case is your result, so you would confirm a critical instead of exploding the die.