If you're below 18,000, feet you'll start by squawking 7600, then descend or climbing to an altitude that is acceptable for VFR cruising. You'll be expected to land as soon as practical while maintaining visual flight rules. If you're above 18,000 feet (Class A airspace) it gets a bit more complicated.