2016 has been a truly eventful year - perhaps more eventful than any previous year in my lifetime - and it still has a few weeks left to run.

On the political front, we had elections to the Scottish Parliament - and I am delighted that the SNP won a third term in office. However, just a few weeks after that election, the EU referendum delivered a political earthquake, with the UK as a whole voting to leave, even although Scotland voted by a significant margin to remain. Almost five months on, it is still no clearer what Brexit will actually mean in practice - indeed, it may well be many years yet before the dust properly settles on the implications of that vote.

And, then, just last week, the world was turned on its head again with what was, at least to most people on this side of the Atlantic, the unexpected election of Donald Trump as the 45th President of the United States of America. It remains to be seen what his election will mean for America and the wider world, but as I congratulated the new President last week, I expressed the hope that he will honour the values of equality, tolerance and human rights, and be a leader for all of America.

The shocks this year haven't just been political, of course. We have also seen the deaths of some much loved figures, from David Bowie at the start of the year to Leonard Cohen just last week, and many more besides. At times, it has felt to those of us of a certain age that we are losing the soundtrack of our youth.

It hasn't all been bad news, though. There has also been lots to cheer us. 2016 has brought great sporting achievement in the Rio Olympics and Paralympics. And, of course, as well as winning his second successive Olympic gold medal, our own Andy Murray won a second Wimbledon title and became the number one tennis player in the world. His brother, Jamie, has also had an outstanding year.

All in all, though, has at times been difficult to draw breath this year.

Until, that is, the weekend just passed.

On Friday, Armistice Day, and again on Remembrance Sunday, the country had the opportunity to pause and reflect, and to pay tribute to all those who gave their lives in conflict.

Remembering the sacrifices of our service men and women is such an important obligation for all of us. We owe respect and gratitude to all those who gave their lives to protect the freedoms that we cherish so highly today, and to the veterans who still bear the scars of war. That is why I was privileged again this year to take part in the annual Remembrance Service in Edinburgh and to lay a wreath on behalf of the Scottish Government. Standing shoulder to shoulder with so many brave veterans - young and old - is a deeply humbling experience and one that means a great deal to me, as it does to so many others.

This act of remembrance is important every year, but I think it is especially important this year as we continue to mark the centenary of the First World War, a horror that is thankfully beyond the imagination of this generation. Earlier in the year I attended services to mark the Battle of Jutland and the Battle of the Somme and at both, I have reflected on how important it is for this and future generations to keep the memory alive - both to honour those who fought and died, but also to ensure that we learn the lessons of the past. It is only by learning the lessons of history that we have any chance of avoiding repeating the mistakes of history. That is why it has been so heartening to see so many school children attend these commemorations.

As every year passes, and the direct, living memory, not just of the First but also of the Second World War, fades, we must work harder to ensure that generations to come learn what happened and, just as importantly, why it happened.

And that perhaps is the most important lesson we should take with us from this year, as the world around us can again seem, at times, like a dark and dangerous place. For all that we are all fiercely proud of our own countries, there is still nevertheless more that unites us as human beings than divides us. And if we resolve to learn and keep learning the lessons of history, and never take for granted the progress that can be made when independent nations work together on challenges that none of us can solve alone, like climate change, the consequences of conflict, and global poverty, then we can build a safer future for the next generation and beyond.

The values of tolerance, equality, diversity and respect for others, regardless of race, faith, gender or sexual orientation, are values we must always cherish. And if we do so, we will make the world a better place for our children and grandchildren.