You don't have to worry about connecting your Mega, just plug the shield into the sockets on the mega, it will supply the 5V needed to power the shield electronics.
You need this to read the specs and instructions.
It includes schematics and library.
Although the system you will be connecting to is 24V, the canbus system is a standard voltage, the 24V of the system does not have to be connected to the shield, just gnd and can-high and can-low.
If you wish to power the Arduino system off the 24V supply, you will need a 24V to 5V DC to DC supply.
Is this a university/school project?
You need to research canbus.
This may help.