Anybody can shoot a gun, but not everybody will hit what they are aiming for. This article gets you familiar with the guns.
Guns are the most common weapon type used in World of Warplanes.
Planes mount different sized guns, which do more damage depending on what caliber the gun is. Currently, guns range from 7.62 mm machine guns on tier I fighters to massive 45 mm autocannons mounted on high-tier aircraft. It can be important to know how effective your gun's caliber can be while attacking other aircraft, as armored aircraft will take less damage than lightly-armored ones. (Main article on caliber is found here). Moreover, different ammo types suit different targets better, and the main article on ammo can be found here
Here are some things to keep in mind while shooting.
As cannons keep firing without any breaks, hot gases and friction from the bullets heat up the metal of the cannon, making it lose its form. In general, this usually leads to a loss of accuracy as the barrel either expands, giving the gas more space to escape and thus reducing bullet velocity, or the barrel simply warps. The best solution to this issue is to simply stop shooting.
This mechanic is implemented into the game as well. As you shoot for extended amounts of time, your cannons will eventually begin to overheat, causing your accuracy to become quite abysmal. As in real life, the best solution for this is to simply stop shooting and allow the cannons to cool down.
In general, heavy fighters have longer overheating times than other aircraft, allowing them to put out more hurt for longer.
There are two types of ranges for aircraft.
First is the firing range. This is the limit to which your bullets will fly, and they are rendered completely ineffective upon passing this limit. You can tell when a target is in your firing range, as the lead indicator (A red square for ground targets, a red circle for planes) will appear.
Next is the optimal range. This is the area where your plane will be able to fire upon enemies with satisfactory hit rates. This means that the enemy is close enough that the enemy takes up most of the area of your bullet spread. There is no marker for your optimal range, so this is a number that you might want to remember (it is given in your plane's stats).
It is usually a good idea to hold your fire until your opponent is not too far from your optimal range, thus guaranteeing that most of your shots are hits. Though it may seem like a good idea to max out potential damage by shooting at an enemy the moment they enter your firing range, your hit rate may soon tell you otherwise.
Technologically, we have not yet mastered the art of making bullets appear in the face of an enemy the moment we fire it. Bullets need time to reach their target, so if you are aiming directly at a plane, chances are that (unless the plane is flying directly at or away from you) by the time the bullets reach where the plane was moments ago, the actual plane has moved on. Thus, it is necessary to lead your targets by a certain distance so that, in effect, the enemy "runs into" your bullets. This lead distance can vary depending on the speed of the plane and how far away the target is from you.
The game has an automatic lead indicator to show where you should shoot at a plane if it keeps its present speed and course (If you feel like the indicator bothers you, or you feel like going hardcore, you can turn the lead indicator off in the settings). However, it only works on planes that are not changing their velocity whatsoever. In an actual game, planes will climb, dive, turn, and boost. Thus, the lead indicator should only be used as a rough estimate of where you should shoot, while you make the necessary adjustments based on how your target is changing their course (As an aside, the lead indicator treats every plane as if they are flying in a straight line, so no, it does not account for planes that are continuously turning).
Likewise, to avoid bullets better, don't fly in a straight line. If you change altitude a bit, turn, and other such things, planes targeting you will have a harder time hitting you, as your lead indicator will be jumping about.
Though mostly unrelated to gunnery, it is a good idea to shoot at a plane from behind, which ensures that the other plane can't directly shoot back, and reduces the risk of ramming significantly. Watch out for rear gunners however, who may shoot back at you while tailing. However, rear gunners suffer from significant range reduction compared to main guns, so don't get too worried about chasing a fleeing plane too much. Just don't let them get too far, or it'll be a waste of a good shot.
There is another, somewhat automated but tougher gunnery, that is, "rear gunnery". The rules of "rear gunnery" are pretty simple - keep the tailer behind you in range of the rear gunner. However, this may be easier said than done, as the rear gunner has much less range and less accuracy (Which means you can't always expect your rear gunner to perform reliably. What's more, he can be knocked out). To check if the tailer is in range, you can press "Q" for a rear view, then line up the enemy to the center of the screen.