I've been asked a bunch of times and added to threads about how credit works. All others feel free to contribute if you have stuff to add, and if you have questions ask. I'll do my best to answer. My experience comes from being in finance (specifically mortgage) for years. I'm not anymore, but the credit principals still apply today.
First point before any advice: don't go out of your way to change your lifestyle to constantly "optimize" your credit score. You will go insane because there is no "perfect" score, and you could follow directions to a T and your report will still give you reasons for why you aren't higher. If you like to pay your bills in full every month, keep doing it. If you like to carry a small balance, keep doing it. If you pay on time, all the time, you will be fine in the long run. When you NEED to raise your score for a loan, you can change you behavior for a couple months to optimize your score, get your loan, then go back to your normal way of life.
Scores: they technically ranges from 450-800+. In my entire time, I only saw less than 5 people below 500. You really have to work to get that low... like literally pay nothing and have TONS of bills unpaid. Likewise you typically don't see much over 800 unless they are older and have decades of perfect credit on many credit lines (current and past). In general, if you are in the 500s, that's really bad and you will struggle to get any loan. Low 600s is bad, and you will be dealing with high rates, big down payment requirements, etc. Mid 600s is fair, and you start to see decent rates on mortgage, still higher rates on cars, and fewer options with credit cards. High 600s is where you can start negotiating good credit terms (680+). 700 is very good, and once you get above 720, you can get pretty much whatever you want. 740 and above is all the same when it comes to getting a loan (you don't get any benefit being 800 vs 740) from what I've seen.
Credit Lines: There are 3 major types - Revolving = credit cards and cause the biggest swings in your credit score. Mortgage = self explanatory. They are hugely impactful lines of credit, but once you have it, your score won't vary much UNLESS you miss payments. Missing mortgage payments are the deadliest in terms of getting home financing. Interesting fact: if you have a HELOC for a 2nd loan, it will often be reported as a revolving credit line (that's what it is). Installment = your standard installment loans. Usually these are car loans or student loans. These have the smallest impact of the 3 on your credit. Missing federal student loan payments can kill an FHA loan, though. Car loans also look at your past car loans closer than mortgage, obviously.
Late Payments: Most people don't realize that if you are late on your credit card or house or car payment, it's not reported. You have to be beyond 30 days late for it to count as a late payment on your credit. So if your bill is due May 15 and you space out and forget to pay until June 1, your credit is unaffected. If you pay June 16th, you are going to see it show.
What doesn't count? The common things you pay that don't show up on credit reports are: medical bills, rent, utilities, insurance. As long as you pay these on time, they don't show up positively or negatively. Utilities and medical bills will show if they go to collections. So if you cancel your T Mobile account and don't pay the cancellation fee out of principal, you will eventually pay for it with a collection/charge off on your credit. Same goes for medical bills. Interestingly enough, while medical collections affect your score, most mortgage programs don't count them against you in terms of derogatory marks. Rent could show up if your landlord decides to sue you for non-payment of rent. If they get a judgement against you, you will get a public record, which hurts pretty bad.
Optimizing your score: here's where things get "fuzzy." Installment and mortgage work the same way (just different impacts). Pay them on time and you are good. The longer your history with them, the better it is. So your 4 year old car loan is seen in a more positive light than your 6 month car loan. If you refi your house or your car, you should expect a drop in your score immediately after. The size of the drop will depend on how much other credit and history you have. So if you have 1 credit card and 1 car loan, and you refi your car, your score would drop more than someone who does the same but has 20 years of credit history, 4 credit cards open, a mortgage, and 2 car payments. All this means that history also counts. If you have an old credit card lying around that you are thinking of cancelling, don't do it if you are trying to get your score up. Keeping that 10 year old card that you use once every 3 months for gas is very beneficial to you. Cancelling it may drop your score.
Now, for the fun one. Credit cards. You actually have the highest credit score by utilizing approximately 30% of your available credit line. So if you think paying off a few of your cards in full will help you, you may be right, but a) it's not necessary to spend all that cash if you want to keep it and b) you won't be at the highest score possible. Of course, maxing out all your cards is far far worse for your score than paying them off in full. But if you are going for a house refi or a car loan, and your scores are right on the line of getting great rates vs good rates, you want to shoot for 30%. As mentioned above, the age of the credit line is important (older is better). And having cards with decent limits on them help, so if you've been afraid to raise you limit from $500 to the $2500 offered, raising the limit helps a bit. Here is where I refer you to my first point above... you don't need to do this all the time because your score is irrelevant until you need to get credit. So if you are more comfortable carrying a zero balance, just do that and you will raise your scores through paying on time and age of your accounts. But if you go to buy a house and you need that slight bump, this is how you can manage your cards to potentially get you there.
Derogatory marks: depending on your salesmanship, you can get some of these removed if you have collections on your credit. If a collection agency can't prove you received notification of a collection notice before they posted it to your report, you can have it removed, assuming you take care of the collection. As an example, when I bought my first house, I pulled my own credit so someone in my office could run my loan. I noticed a collection for like $138. I called and found out it was for a Wall Street Journal subscription I didn't pay in college. I told them that this was the first I even heard of it and I was happy to pay it if they could remove it from my credit. I paid, they removed it. Now, it's seldom that easy and you will likely have to fight it a bit more, probably start by offering a lower amount but the full amount if they remove it, and tell them to send you a letter stating they will remove it so you can take it to the bureaus yourself. Also, paid collections are better than unpaid if you have them. However, a SETTLED collection where you pay less than the full amount can still show up as unpaid, and they do not have to fix that. You technically didn't pay the collection, you just payed an amount they agreed was enough to not harass you any more with calls and letters. Very few people know that.
Inquiries: There are also tricks here most people don't understand. Having many hard inquiries on your credit can negatively impact your credit. A hard inquiry is a credit report pull. There are also "soft" inquiries, which are usually credit checkers like Credit Karma. Soft inquiries have no impact on your credit. So hard inquiries are basically bad; however, to get a loan, you need to get your credit pulled by the lender. If you are car shopping or house hunting, don't be afraid of 3 or 4 dealerships pulling your credit on the same weekend. The credit bureaus recognize that this happens, so they will group all related inquiries in a 30 day period together as 1. For example, you go to 5 car dealers over 2 weekends and all of them pull your credit. The bureaus recognize all 5 of those inquiries as 1 inquiry b/c they are all related. So don't be that guy who freaks out at the car finance guy for pulling your credit if the last dealership just did. And under no circumstance will a lender accept a credit report pulled by anyone but themselves. So don't pull your own credit or take the one from one dealership and slap it down on the next one's desk and say "You are using this one!" They can't and they won't.
That's a solid start. Lots of stuff, but hopefully it helps people with questions they may have. Others who are familiar with it may disagree b/c there are a lot of different versions of what you need to do. Ultimately there is no perfect method b/c there is no perfect score. If you have further questions, ask away.