Most sea kayaks are designed to track well (go straight) when the boat is upright, and to turn easily when the boat is tilted. The more the boat is tilted, the less effort it takes to turn. Tilting a kayak shortens the length of the hull in the water, changes the hull shape so that the bow and stern have more upsweep (rocker), and reduces resistance to turning. The degree to which you tilt the kayak and your body will depend on how comfortable you feel and how sharply you need to turn. There are two ways to tilt the boat: edging and leaning.
Edging: By lifting one of your knees and simultaneously lowering the opposite butt, you can tilt the kayak and still keep your torso fairly upright with your head over the boat. This keeps your center of gravity over the kayak. We edge to assist turning, or to maintain course when currents or winds try to turn our boats, or to stay upright on waves and other turbulence. Edging is a component of just about everything you'll want to do in a kayak.
Leaning: Leaning, on the other hand, involves moving your torso and head out away from the kayak's center of gravity. Leaning is used less frequently, but is valuable for many conditions, such as executing aggressive turns that use support strokes.
Here are some tips to help you become flexible and comfortable edging the boat. With someone close by, see how far you can edge your kayak without losing your balance. Develop a personal "edging scale" from 0 to 5, where 0 is upright and 5 is the furthest you can edge without having to brace with your paddle. In most sea kayaks, you can edge until the spray deck touches the water. Once you find the balance point (edge #5), how long can you stay there? Try paddling forward normally, then edge without changing your stroke. Now, paddle in a straight line for several minutes while edging at #2,#3 (whatever suits you). Edge first on one side, then the other. Gradually increase the angle of edging until you are comfortable at #5! The more comfortable you are with edging, the better, easier, and more enjoyable your boat handling will be. Once you become comfortable edging your kayak, you'll experience a major improvement in your ability to maneuver the boat, you'll be comfortable in "interesting" conditions, and you'll simply enjoy the physical experience of being part of the boat as it responds to the rhythms of the water!