If you've decided to make your own way to the Great Wall, rather than using a private tour guide or a group tour, you can get there by bus, train, or taxi. The tradeoff is cost versus convenience.
The easiest way to reach the Great Wall is by taxi. This can also be expensive if you're traveling a long distance. The most economical way to reach the Great Wall is by bus, but only a few Great Wall locations have bus service from bigger cities, so you may need to take more than one bus to get there.
Unless you're going to a very popular Great Wall location that has direct bus or train service, you may want to combine bus and taxi service. For example, from Beijing, you can take a bus to the Miyun or Huairou urban area, and from there you can economically take a taxi to your final Great Wall destination.
If you're in Beijing, you can take the 919 bus from the Deshengmen station to Badaling. From there you can find a taxi to take you to other nearby Great Wall locations. From the Beijing Dongzhimen long-distance bus station, you can take bus 916 to Huairou or bus 980 to Miyun, and from there you can find local buses or taxis to take you to your desired Great Wall location. In all of these cases, there are multiple buses with the same bus number, so try to get the fastest, most direct bus in order to save time. You don't need a ticket to board these buses. Just get in line and then get on the bus. While you are on the way to your destination, someone will collect your payment.
Driving in China is an exciting adventure for those who have never experienced it before. Most Chinese drivers seem to treat driving like some kind of competition. I can't count how many times I have been in a vehicle in China whose driver seems madly possessed to overtake the car ahead. And overtaking can include driving in the oncoming traffic lanes, even when there is oncoming traffic, or going off the road completely on either side of the road. And once the pass is victoriously completed, the driver usually slows down to a reduced speed, ostensibly in order to save fuel, and will then invariably be overtaken by the car that was just passed.
Making driving even worse in China is the fact that many drivers in China have little experience. Police are rarely seen, and when they are, they don't seem interested in what other drivers are doing anyway. There is a huge variety of vehicles on the road, from fast, new cars to old 2-stroke farm vehicles carrying unbelievably huge loads. Add to this mix vast numbers of bicyclists and pedestrians, many of which don't seem to be paying any attention to the fact that there are motor vehicles using the same roads. Roads are also used for many other purposes, such as makeshift vendor stands, food processing, playing card games, and more. And road conditions are highly variable, from old and narrow roads in desperate need of repair to new, wide, smooth highways.
If you're thinking about driving yourself in China, consider carefully. You cannot use an international driver's license; you must pass the test to get a license in China. You cannot rent a car without a Chinese driver's license. The reality is you will have to depend on other drivers in China unless you want to avoid road transportation altogether.
There are several possibilities for returning from the Great Wall after your walk. If you're at a popular Great Wall location, you should be able to find a taxi or, at certain locations, a bus. If you aren't confident about being able to find a taxi, you can ask your driver to wait for you or to return later to pick you up at an agreed time. This is a reliable arrangement as long as you haven't paid the driver in advance. If you have a driver's phone number, you can also call them when you're ready to be picked up.
Another possibility is to get a ride with someone that has private transportation. It's not at all unusual to make new friends while you're walking on the Great Wall. Many Chinese people enjoy the chance to meet and talk with a foreigner. As you meet people on the Great Wall, ask them how they are getting back to town and often they will invite you to come along. In this case, you might want to offer some gas money or to pay for some dinner, although your offer is likely to be politely turned down by your new friends who would not want to tarnish the memorable experience by accepting your money.
Some general information on taking taxis in China can be found here.
These are the most up-to-date Engish language Chinese train schedule timetables I have found on the Internet:
Jiangjunguan Great Wall
Take bus 918 at the Dongzhimen bus station to arrive at the terminal in Pinggu, and change to bus 9 to Jiangjunguan
Simatai Great Wall
Tourist bus 12 from Xuanwumen and Dongsi shi tiao; or take a bus from Dongzhimen bus station to Miyun, and then change to a local bus or take a taxi
Bailingguan, Gubeikou, or Jinshanling Great Wall
Take a bus from Dongzhimen bus station to Miyun, and then change to a local bus or take a taxi
Mutianyu Great Wall
Tourist bus 6 from Xuanwumen, Qianmen and Dongsi shi tiao; or take bus 916 from Dongzhimen bus station to Huairou, and then change to a local bus or take a taxi
Huanghuacheng Jiankou Lianyunling Xiangshuihu Great Wall
Take bus 916 from Dongzhimen bus station to Huairou, and then change to a local bus or take a taxi
Shuiguan Great Wall
Bus 919 from Deshengmen bus station
Badaling or Juyongguan Great Wall
Bus 919 from Deshengmen bus station; or Tourist bus 1, 2, 3, 4 or 5
Datong Great Wall
Buses depart from Liuliqiao bus station every 50 minutes starting at 7:40AM
Shanhaiguan Great Wall
Two trains per day from Dandong; more from Xingcheng.
Bailingguan, Gubeikou, Jinshanling, or Simatai Great Wall
Take train L671, which starts at 7:25 AM from Beijing North railway station, get off at Gubeikou, and then change to a local bus or hire a taxi. Train 6453 also goes from Beijing North to Gubeikou.
Mutianyu, Jiankou, Huanghuacheng Great Wall
Take train from Beijing North station to Huairou, and then take a taxi or local bus to destination.
Juyongguan, Shuiguan, Qinglongqiao, or Badaling Great Wall
Take train 6427, which goes from Beijing North to Shacheng. Get off at Juyongguan, Qinglongqiao, or Badaling station.
Lanzhou or Jiayuguan Great Wall
Take train T151, T75, T69, or T27 from Beijing West railway station to Lanzhou. Daily overnight trains between Lanzhou and Jiayuguan.
Datong Great Wall
Take express train K615 from Beijing West railway station to Datong.
Chinese railway schedule timetables