Getting good teacher recommendations
In order to get the best teacher recommendations, you need to approach teachers who know you well (and can speak to your abilities, your work ethic, and your character) and give them enough time to write you a high quality recommendation. Cultivate relationships with your teachers, even if you don't think you'll need a recommendation from them. Ask them nicely if they'd be willing to write you a recommendation.
Give them plenty of lead time--at least 2 or 3 weeks, if possible. If you ask the night before a deadline, even if you're a wonderful student, it might be harder for a teacher to put the time into presenting you as well as they might have been able to otherwise.
If they agree, ask if they would like (and be ready to provide) a resume or sheet of paper with information that they might want to include or highlight. If they agree to write you a letter, but they don't know much about you outside of class, you might want to set up a half hour time to speak with them about the colleges that you're applying to, what you're interested in studying, and why you would be a good fit at those colleges. Be the student that it's a pleasure to write letters for, and you'll get better letters.