Simply replace the unfilled areas such as "" and "[date]" with your information.
Dear [name of spouse]
Thank you for all the years that you have dedicated to me. I know that I am not always the easiest person to deal with, and we have had our share of struggles. I have caused many of those struggles, and know that I can infuriate you.
But I do still love you with all my heart, and I want you to know how much I appreciate all you do for me each and every day. I don't always express my gratitude, but you should know that you mean the world to me. If I am ever taking you for granted, I am sorry, and I will try to communicate more often how glad I am that you are in my life.