Hi,
Match the marked wifi101 pins to the mega pins and push the two together.
Install the wif101 library from GitHub - arduino-libraries/WiFi101: Wifi library for the Arduino WiFi 101 Shield
The library contains examples.
wifiwebclient should get you started.
David