In what would turn out to be her last ever New Year’s message, Nicola Sturgeon told Scotland that there was “much to look forward to” in 2023.

Her government would, she added, be "looking to the longer term with optimism and resolve.”

Five weeks later, she was gone.

Friends and supporters said her reasons for quitting after eight years in the top job, and seven as deputy, were, as she said at the time, partly political and partly personal.

“In my head and my heart, I know that time is now,” she said.

“Giving absolutely everything of yourself to this job is the only way to do it. The country deserves nothing less. But in truth that can only be done, by anyone, for so long.”

The Herald:

That the job was taking its toll was no surprise, given the litany of difficulties which all seemed to have piled up by January.

Firstly, there was independence. Her gamble the year before had failed. The Supreme Court made clear that Holyrood could not hold an independence referendum without the UK government's consent.

Her plan to use the next Westminster election as a de facto referendum was being fiercely resisted, and there was soon to be a very public rammy at a special conference.

Ms Sturgeon said she realised that her view as leader would carry enormous, probably decisive, weight in that debate.

Standing aside would, she said, allow the party to come to a decision on the best way forward without having to consider the potential impact on her leadership.

Secondly, there was gender reform and the case of Isla Bryson.

MSPs passed the Gender Recognition Reform Bill (GRR) in December last year by 86 votes to 39, following one of the most divisive and bad-tempered debates Holyrood has ever seen.

However, before it could become law, Scottish Secretary Alister Jack blocked it by using the first-ever order under Section 35 of the 1998 Scotland Act.

Ms Sturgeon vowed to challenge the decision in court, but before the Lord Advcoate could don her wig, the gender reform row exploded when double rapist Isla Bryson was placed in a women's prison.

Bryson was found guilty of raping one woman in Clydebank in 2016 and another in Glasgow in 2019 at the High Court in Glasgow last month.

The 31-year-old began identifying as a woman only after being charged.The Herald:

Although not a result of the legislation, the Scottish Prison Service had adopted its central premise, allowing people to self-identify as a new gender.

Having previously championed this principle, Ms Sturgeon appeared to undermine it when she refused to say if she thought Bryson was a man or a woman

Thirdly, there were the money questions.

Her husband, Peter Murrell, who was at the time the SNP’s Chief Executive loaned more than £100,000 to the SNP It was donated to the party in June 2021 to help it out with a "cash flow" issue after the last election.

This also came as Operation Branchform, the police investigation continued into the whereabouts of £600,000 that was raised from supporters in 2017 for the purposes of a future referendum campaign.

If the party was caught off guard by her resignation, they were completely unprepared for the leadership contest.

Many names were suggested, many names looked at the list of problems facing the party, and said no.

In the end, Humza Yousaf, Kate Forbes and Ash Regan were the three hopefuls in what was a gruelling, ferocious and divisive campaign From the start, Mr Yousaf was the favourite of the party establishment, winning endorsements from many in the cabinet.

Though Nicola Sturgeon insisted she would not endorse any of the three MSPs vying for her job, she didn’t really need to.

The now ex-health minister was backed by John Swinney, her faithful deputy and by Shona Robison, her best friend in politics.

Ms Forbes near torpedoed her own chances very early on when, just hours after launching her campaign, she told reporters she would not have voted for Holyrood’s equal marriage legislation had she been an MSP at the time.

By lunchtime the next day, the MSP for Skye, Lochaber and Badenoch - a member of the socially conservative, evangelical Free Church of Scotland - had lost at least half of her original supporters in parliament.

There were difficult moments for Mr Yousaf too. The start of his campaign was almost derailed over questions about his commitment to equal marriage.

Though he backed the legislation at its first parliamentary stage in November 2013, he missed the final Stage 3 vote in February 2014.

The most startling moment came during the first televised hustings on STV on March 7, when Ms Forbes went all in, gloves off, landing a devastating blow on Mr Yousaf.

"You were a transport minister and the trains were never on time, when you were justice secretary the police were stretched to breaking point, and now as health minister, we've got record high waiting times. What makes you think you can do a better job as first minister?”

The remark left Mr Yousaf absolutely stunned. It also reportedly left Nicola Sturgeon furious.

The result was closer than expected - Mr Yousaf won with 48.2% of first preference votes and 52.1% of the vote after third-placed candidate Ms Regan's second preferences were redistributed.

The Herald: The SNP leadership race was between, from left, Ash Regan, Humza Yousaf, and Kate Forbes

More than policy differences or personality clashes, the race for Bute House revealed the chaos inside party HQ.

It all came to a head in a row over the size of the party’s membership.

During the contest, after pressure from the three candidates, the party revealed the total number of members eligible to vote was 72,186.

That confirmed a Sunday Mail report from February that the SNP’s membership had slumped by 30,000 since 2021. A report which Murray Foote, the then head of communications, had dismissed as “drivel”.

He resigned, blaming senior colleagues for giving him duff information. 

The pressure on Mr Murrell became too much and he resigned two days later, hoping, no doubt, to keep out of the limelight.

However, little more than a week after the leadership contest, he was arrested and quizzed by detectives as part of Operation Brancform.

The home he shares with Ms Sturgeon was raided, so too was party HQ in Edinburgh.

A luxury campervan that had been parked outside the home of his elderly mother-in-law was seized by police.

The SNP’s then treasurer Colin Beattie and Ms Sturgeon were also subsequently both arrested.

All three were released without charge, pending further investigation. Despite rumours of impending police action, Police Scotland has still not submitted a report to the Crown Office and Procurator Fiscal Service over their investigation.

The Herald:

Mr Yousaf - who positioned himself as the continuity candidate during the contest - has struggled to overcome events.

He did however manage to get the party to ditch his predecessor’s plan for independence.

At a subdued SNP conference in Aberdeen, delegates backed what is effectively the party’s fourth position on quitting the UK in a year.

The Scottish Government will “begin immediate negotiations with the UK government to give democratic effect to Scotland becoming an independent country” if the party wins the majority of seats at the general election.

It was not universally popular. Memorably, activist Graeme McCormick described the strategy as “flatulence in a trance” because “nobody knows what we are talking about”.

During his speech, Mr Yousaf told activists that they “must move on from talking about process to talking about policy.” 

“It is with honesty that I tell you there is no short cut that will get us independence,” he said. “I tell you what will: listening, campaigning and persuading.”

The Herald:

Support for a Yes vote remains fairly consistent, hovering anywhere between 45% and 50%. However, support for the SNP has dropped.

The most recent survey, carried out for Redfield & Wilton, had Labour leading the SNP by 36% to 34%.

Nowhere was the SNP’s falling support more evident than at the Rutherglen and Hamilton West by-election, triggered when Covid rule breaker Margaret Ferrier’s constituents ousted her in Scotland’s first recall petition.

The party expected to lose, but the scale of the defeat left them stunned.

A 20.4 percentage point swing to Labour saw Michael Shanks secure 17,845 votes, some 9,446 more than Katy Loudon.

The new MP took more than 58% of the total votes cast.

The Herald: Labour’s Michael Shanks won in Rutherglen (PA)

The next day, Mr Yousaf insisted that the “buck does absolutely stop” with him, but he added that there were also “some very difficult contextual factors” around the by-election.

“Margaret Ferrier’s reckless actions, of course, came up time and time again," he told broadcasters outside Dundee's V&A.

“And the police investigation, of course, has engulfed the party over the last few months and, again, came up on a number of doorsteps.

“There's a number of difficult issues around this by-election that have made it a very difficult night for us indeed.”

The First Minister said his voters just simply “did not come out” at the by-election.

“I've got to make sure I'm inspiring them, inspiring the public, to come out.”

With a general election next year, the First Minister is running out of time to inspire his supporters.

It’s not the SNP-Labour marginals that are at risk, but some of the party’s safest seats could be up for grabs too.

If the party are wiped out, the SNP's 2024 might just be as chaotic as their 2023.