There are various techniques you can use to avoid the different types of air-to-air missiles. As a general rule though, situational awareness is absolutely key, you should be looking out to see if any aircraft around you could have air-to-air missiles and judging what type they are likely to have. If an enemy is on your tail keep looking to see if a missile is launched. You may not get a visual warning (depending on missile type) and even if you do it may be too late.
Avoiding command-guided and beam-riding missiles
Against command-guided missiles like the AA-20 Nord or beam-riding missile like a Fireflash, begin maneuvering to make it hard for the enemy player to hit you. Any maneuver pulling more than a few G's will likely cause the missile to be unable to follow from the enemy player's input or beam.
If either missile type is fired at you in a head-on, then abandon the head-on immediately, if you don't the proximity fuse will get you.
Avoiding heat-seeking missiles
How you best avoiding heat-seeking missiles depends largely on what missile was fired at you; it is recommended to familiarize yourself with what missiles different planes carry and what the characteristics of each are.
For early missiles, you should be able to turn tighter than the missile and make it lose its lock that way. For missiles which you can't simply throw off with a hard turn your options are more limited, you can try pulling a sort of barrel roll maneuver, the combination of turning hard and rolling can sometimes throw the missile off. Depending on how far away it was launched, it may be possible to outrun the missile, making gentle side-to-side maneuvers to maximize the missile's flight path while maintaining speed. A final option is to maneuvers your aircraft so that it is directly between the missile and the sun, causing the missile to lock onto the sun; although this is rarely possible in battle situations, this can be done pre-emptively (i.e. fly towards the sun when you spot an enemy with air-to-air missiles on your tail).
If you have flares deploy them and turn sharply so you get away from the missile seekers field of view. Advanced heat-seeking missiles can have IRCCM (InfraRed Counter-Counter-Measures) which are not easily confused by flares and would require additional maneuvering to throw off the missile's intercept path.
Keep in mind for aircraft with particularly hot afterburners, it may be necessary to power down the engine slightly when deploying countermeasures so that the heat-seeking missile does not continue to seek the hottest item in its path amidst the flares.
Avoiding radar-guided missiles
Like IR-guided missiles, the best method of dodging radar-guided missiles largely depends on the missile. Early missiles can be dodged kinetically, by turning and rolling vigorously to throw off the missile's lead. In the case of a more capable missile, it may be easier to break the radar lock from the opposing aircraft instead - this can be achieved by deploying chaff, and also notching against pulse-Doppler radars. This can also apply against active radar-homing missiles, breaking the radar lock of the missile itself rather than the aircraft's.
In a low altitude head-on situation, the radar in question will commonly be in pulse-Doppler mode, so your best defense is to point the nose down, which will cause the incoming missile to calculate the interception point below the ground surface and thus make it crash.
This will however not work if the enemy is at a higher altitude than you, because the interception point will be still above the ground. This at the same time means that if you are attacking in such a situation loft the missile up so it will have more probability in hitting the target, unless you have to evade yourself. Flying particularly close to the ground can also cause missiles to lose track of their target signal within the ground clutter, causing them to harmlessly veer off course.
At high altitudes, radars in simple pulse mode become more prevalent, against which notching is not effective. If you see the missile early enough, a side-to-side maneuver can be utilized, which will burn energy from the missile, slowing it down and also causing it to turn very hard to intercept, after which it will be unable to maneuver hard enough to hit after you change direction.