Fare basis codes aren’t solely for airline staff, and knowing your booking class can tell you in advance whether it’s even worth asking about things like upgrades. Within the fare code, one or two letters can tell you what fare class you have.
While the letters can vary a bit by airline, an “F” nearly always means first class, while business class is often indicated with a J, C, or D. Economy class has a long potential list of letters associated with it, with Y, L, M, Q, T, B, and K being among the most common.
Many airlines have a list of the fare codes they use on their websites—a simple web search for “fare codes [airline name]” brings up the relevant results. You can also consult your booking confirmation email, which may even list the fare class in a more straightforward way—such as “Economy (Y).” Using that information, you can look into the fare rules or restrictions for that class to find out what options you have on your ticket.
Here's an example of American Airlines' fare chart, which details the amount of qualifying frequent flyer miles earned per fare code.