There is no hidden trick.
Grab your flashlight and get down under the bike, looking up at where the brake pedal bolt goes through the frame and pokes out the other side.
See that wire clip through the hole at the end of the bolt?
Remove it.
Using the correct size allen socket, remove the pedal bolt.
Unhook the brake pedal return spring and the brake light switch from the pedal.
When installing the pedal bolt, clean the pedal and the bolt and apply grease where the pedal pivots on the bolt.
It goes back together in reverse order.