AP Econ Marginal Cost Question

How does one determine the curve shape for MC? Sometimes it dives down a little bit, then shoots up. However, other times I notice it’s just a straight line. Does it depend what we are talking about or what? Thanks.</p>