It's detailed on page 278 of the Players Handbook.
There are 2 relevant passages for your question.
The first says you do Maximum damage: Rather than roll damage, you determine the maximum damage you can roll with the attack.
The second is Extra Damage: Magic weapons and implements, as well...