I have a power source running from the light how do I connect it to a switch?
In general, a light switch breaks the hot wire lead when it is off and connects the hot wire lead when it is on. The neutral lead and the ground lead are never broken (that is, they are connected, either continuously, or through a permanent attchment, such as a wire nut).
Power source through switch box - When power comes through a box containing a light switch and continues on to the light, the switch is attached on one terminal to the black (or sometimes red) line from the power source and on the other terminal to the black (or red) line going on to the light. The white neutral from the source and the white neutral to the light are connected directly. The bare or green ground lines are also connected (but are not show).
Power source directly to fixture - When you want to add a switch to a light that is "hot" at the fixture, you can run a new 3 wire cable from the fixture to a box containing the new switch. The black caries the "hot" to the switch, the red carries the hot back to the fixture. Both will be "hot" when the switch is on.
Most basic switches do not use or need the neutral line, but one is included for more complex switches that need to be powered. The ground line (green or bare) should be attached to the ground screw on the switch (but is not shown).
At the fixture, you connect the black "hot" coming in from the source to the new black wire running from the switch, and the red switch wire is connected to the black "hot input of the fixture.
These descriptions of wire color are US conventions. In other countries, the color pattern may vary, but the principles are the same.
THIS ANSWER HAS BEEN UPDATED: Thanks to mfarver for the correction about neutrals to switches.
If I understand the question, you are asking how to wire a light fixture when the power is coming from the light box. I am assuming that you have no power coming from the switch.
The White (Nuetral) wire coming from the ceiling box power will go the the white wire of the light fixture (or silver screw if it has no white wire) The Black wire coming from the ceiling box power will tie to the white wire going down to the switch. Mark this white wire to indicate that it is now a power wire. The black wire coming from the switch will go the the black wire of the light fixture (or gold screw if it has no black wire)
If you asking this question, I'd assume you likely are uncomfortable with wiring. (If not, just follow the other two answers on how to place the switch upstream on the hot line.)
As an alternative to having to do any wiring, you can add a switch entirely wireless by purchasing a zigbee bulb and zigbee switch.
As of 2018 zwave bulbs cost between $8-15 and the switches $25-40. So for about $40 you get the advantage of not having to cut any holes in your dry wall for the switch box, or to feed your fish tape up to the light box, along with not having to buy a switch box, switch, ROMEX, and wire nuts (~$8-$16 depending on the length of Romex). Plus, if you get a home automation hub in the future, you'll be able to control your lights via it's smartphone app, or home assistant API.