מרים המתינה למשה שעה אחת שנאמר (שמות ב, ד) ותתצב אחותו מרחוק לפיכך נתעכבו לה ישראל ז' ימים במדבר שנאמר (במדבר יב, טו) והעם לא נסע עד האסף מרים
Reb Moshe answers that the Torah teaches us that davka when Miriam was being punished, she became a Metzora'as for her Lashon Hara against Moshe Rabbeinu, do we need to realize that she was still the great Miriam, and that her sin and punishment do not diminish the degree of respect and hakaras hatov we have to her.
Darash Moshe:
והעם לא נסע עד האסף מרים [יב טו] תמוה לכאורה מה שהשי"ת הראה הכבוד למרים בעת צרעתה שבא על ידי החטא שלה, וכי אם לא חטאה לא היה חולק לה כבוד שרוצה לחלוק לה. אבל נראה שהוא להודיע שכל כך חביבה היא לפני השי"ת שגם בעת חטאה הוא אוהבה ביותר מצד מעשיה הטובים ואף אז רוצה לכבדה וליתן לה שכר. וזהו אולי גם מה שנאמר בשאול שתבע העונש וגם השכר כדאיתא ביבמות [עח ב] מקרא דאשר משפטו פעלו, באשר משפטו שם פעלו, ובאשר שהוא ענין גדול ניתן לד הכבוד עתה.
ויבקש דוד את פני ה' מאי היא אמר ריש לקיש ששאל באורים ותומים מאי משמע א"ר אלעזר אתיא פני פני כתיב הכא ויבקש דוד את פני ה' וכתיב התם (במדבר כז, כא) ושאל לו במשפט האורים לפני ה' ויאמר ה' אל שאול ואל בית הדמים על אשר המית הגבעונים אל שאול שלא נספד כהלכה ואל בית הדמים על אשר המית הגבעונים וכי היכן מצינו בשאול שהמית הגבעונים אלא מתוך שהרג נוב עיר הכהנים שהיו מספיקין להם מים ומזון מעלה עליו הכתוב כאילו הרגן קא תבע אל שאול שלא נספד כהלכה וקא תבע על אשר המית הגבעונים אין דאמר ריש לקיש מאי דכתיב (צפניה ב, ג) בקשו את ה' כל ענוי ארץ אשר משפטו פעלו באשר משפטו שם פעלו
We offer another simple and true mussar haskeil. It is human nature to not appreciate things until we are about to lose them. Davka when we were so close to losing Miriam were we able to realize how much we owed her, how great she was, and how much she meant to us. Same with Moshe Rabbeinu. When he was alive and healthy, עוד מעט וסקלוני. When we were about to lose him, we said we would not let the Ribono shel Olam take him from us. (This is not a criticism, it is just a fact.)
There is a small caveat here. In truth, this kind of hakaras hatov, which should be constant and deeply felt, might be a problem. Samei'ach b'chelko is wonderful, but to realize how many things we ought to be endlessly grateful for might not be possible. There's just so much to be grateful for - vision, hearing, mobility, the ability to breath easily, having food to eat, people that care if you live or die even when you don't - it would be either paralyzing or it would suppress any desire to improve our lives.)
The answer is that Chazal told us when we need to focus on all our wonderful gifts - and that is when we say birkos hashachar. Once a day, early in the morning, thank God for giving you the ability to walk, to see, to do mitzvos, to be aware of your surroundings. Say birkos hashachar with real feeling. That, I think, is the best we can do.