Decide if you want to make rough circular beams or roughly square beams, as the two require slightly different methods. Put on all safety gear for working with a chain saw. Not only is this type of work dirty, with wood chips flying everywhere, but it's loud, so use earplugs. Also ensure you use a full face mask with head protection, not simply safety glasses.
Cut the limbs of the trunk off if you want circular beams. Hold the chain saw firmly in your grip -- with your main hand on the handle with the trigger, and your off hand holding the grip on top of the saw. Stand to whatever side you're more comfortable working from. Push the blade down into the limbs or pull it upward through them, avoiding the kickback portion of the blade. Cut the limbs off tight against the trunk of the wood.
Cut the beams into a roughly square format if you prefer. Follow the same instructions for cutting off the limbs, but instead of merely cutting off the branches that stick out from the trunk, cut into the body of the trunk to cut the roundness off the beam. Work your way down the beam as you go, cutting from the uphill side, so that you can roll the log as necessary to work on another side of the round trunk until you've cut all four sides off square.
Cut the ends off the beams according to the length you need for your structure. Stand on the uphill side of the beam and cut with the blade to one side of your body (whichever side is your main hand side). Avoid cutting with the kickback portion of the blade. Push the blade down into the wood or pull it upward as necessary.