The ballast should have a wiring diagram on it. The exact wiring depends on what kind of bulbs you are using. Suggest you get an electronic ballast, these will automatically sense the load & fire up many different kinds of bulbs.
Generally, black & white are your power in, green the ground. The others - red/blue/yellow goes to the endcaps.
The easiest is to get a ballast kit, where the ballast is enclosed & pre-wired so all you have to do is attach your endcaps. The cheaper way is to buy the parts & wire it yourself (I brought a couple of electronic shoplights & pull the guts out - cheaper than getting parts seperately.) In that case you would need some kind of enclosure for all the electrical connections. (Although you will see some pics on the net with everything exposed, I wouldn't do it in for safety reasons.)
I couldn't find any standard enclosures for my ballasts. (You can buy specialized ballast/enclosure kits for fish tank .... but then you may as well go prewired.) You can build a compartment inside the canopy (or better yet, outside of the canopy) to house them. I enclosed the actual wire connections in a plastic outdoor electical junction box which is water tight. With all the connections enclosed, you minimize the risk of water shorting out your wires & posing a hazzard. Even then, I would pulg the whole thing to a GFI outlet for additional insurance.
Note that the DIY enclosure is NOT up to code (It is not UL tested for one .... ) If you wish to have everything up to code, you are best to get a ballast kit.