Research your airline's frequent flyer miles program before you book your ticket. If you frequently fly with a single airline, there may be ways to use accrued frequent flyer miles to upgrade an existing seat.
Look up the ways in which your airline codes passengers. Every passenger's ticket has a code indicating what type of seat they have and if they are eligible for an upgrade. Find this code and write it down. This will allow you to ask the employee at the ticket counter to put the code on your ticket, which will indicate to the gate agent that you are eligible for a seat upgrade.
Charm the employee at the ticketing counter. If you have previously been unable to secure an upgrade before arriving at the airport, being nice can work. This all depends on how many open seats are available in first class, but a courteous manner and a polite request can work wonders.
Drop hints that you are traveling because of a special occasion such as an anniversary or an engagement. Sometimes, airlines will honor you with an upgrade.
Ask your flight attendants if empty seats in first class are taken when you are boarding the plane. This is the last step you can take to try to secure an upgrade before the plane takes off. If first class seats remain empty, right before take-off, flight attendants may consider upgrading you.