The only certain way is to pay for an upgrade.
Otherwise you chances are slim but not zero. Dress smartly, be polite. Check in just before checkin closes* - but don't leave it too late or you won't get on at all, since the flight needs to be over-booked in economy to begin with.
Join the airline's frequent flyer club and do lots of flights.
*This does have its disadvantages if you are NOT upgraded, as is very likely - you'll get the last and worst seats in economy and may not be together.