Congmiserations, Ed Miliband. Given the mix of opportunity and peril that faces you, it seems right to offer both congratulations and commiserations. You have just become the 10th postwar leader of the Labour party. It is a sobering thought that only five of them (Attlee, Wilson, Callaghan, Blair and Brown) became prime minister; only three (Attlee, Wilson and Blair) won elections; and just one (Blair) managed to secure more than a single term with a decent parliamentary majority. After being removed from office, Labour tends to spend a long time out of power: after 1951, 13 long years; after 1979, 18 even longer years; after 2010… Well, that is now in your hands.

Enough, for the moment, of depressing you. Everyone deserves a honeymoon for at least five minutes. So let us start with reasons for you to be cheerful. First, you take the helm of a Labour party which is broadly united. Though the leadership contest set brother against brother, it was generally an unfratricidal affair. There is not a raging ideological divide of the sort that has crippled the party in the past. The more subtle risk is that the party will too easily coalesce around positions which are just a bit too left of electable.

A second reason to be positive is that Labour looks willing to be led providing you have the confidence to lead. You have 257 MPs, which is a much more substantial parliamentary contingent than Tory leaders of the opposition had behind them after their 1997, 2001 and 2005 defeats. The morale of your troops is quite buoyant. They look up for the fight with the coalition. If anything, some of them are too trigger-happy. One of your challenges will be to marshal your parliamentary army to pick its battles with the government on sensible ground.

One of your earliest and trickiest decisions will be how to deploy your defeated rivals. Ed Balls used the leadership campaign to showcase how effective he can be as a pugilist against the government. He is desperate to be shadow chancellor, the second most important role on the opposition frontbench after your own, and he will be unforgiving if you don't requite his ambition. You may be tempted to divide and rule by giving the job to his wife, Yvette Cooper, who is a good bet to come top of the shadow cabinet elections. That will probably make him even angrier. But you won't forgive yourself if you set things up for a second generation of the Blair-Brown uncivil wars.

On your brother David, you have inflicted a searing psychological wound. In your acceptance speech, you said: "Never in my wildest imagination did I think that one day I would lead this party." Nor in his. If you are successful, you will be prime minister, not he. If you fail, the Labour party will not choose as its next leader another Miliband. He was graceful in his acknowledgement of your victory, but he will have to be a very big man indeed to serve as your subordinate. Don't be surprised if he doesn't hang around for longer than is necessary to look dignified.

You become leader of the opposition at what seems like a potentially very fruitful time. After fewer than five months in office, the coalition's approval rating is already sliding into negative territory. That's before the government has started to implement £80bn in spending cuts and before VAT has been hiked to 20%. Everyone I spoke to at the Lib Dem conference last week expects the spending squeeze to be horrendous. In the words of one Lib Dem Minister: "It will be shite."

Labour has already recovered its polling position to around level-pegging with the Tories. Unlike in the 80s, when Labour competed with the Liberals and then the Alliance to be the main opposition to Margaret Thatcher, you lead what is now the sole national opposition party. You ought to be able to move Labour ahead in the polls in the coming months. That will make your party feel good while straining the coalition. It promises substantial gains for Labour in next May's elections, including those for the Scottish Parliament.

Therein lies a trap for your party. The temptation for Labour is to assume that a tidal wave of protest about the cuts will be enough to float you back into Number 10 at the next election. I really would not bet on that. It is possible that the coalition will melt in the heat of public anger, but unpopularity is as likely, if not more so, to bind them closer. The worse the Lib Dems do in the polls, the more Nick Clegg and his colleagues will want to avoid an early election at which they would be smashed.

So you must be prepared for the possibility that the coalition will endure being unpopular, last the distance, recover and go into the next election offering some tax cuts and spending boosts as the pay-off for the earlier austerity. If you have not been careful about how you oppose them now, you will then find yourself stranded on the wrong side of the big political argument.

Margaret Thatcher became quickly unpopular after the 1979 election, but went on to win in 1983 and again in 1987. Recovering a reputation for economic competence is key. Your most imperative task is to put Labour in a sensible posture on the deficit. You will be absolutely right to challenge the coalition for cutting so deep and quick

Even if you didn't think it was reckless with the economy, it is the job of the opposition to challenge. But blindly opposing every spending reduction while failing to specify other choices will ultimately do much more damage to your credibility than it will do to the coalition. Be careful of your friends in the trade unions. It is thanks to their votes that you owe your narrow victory over your brother, who beat you among MPs and party members. You will have to quickly disabuse the unions, and everyone else, of any idea that this means that you are owned by the unions. Alan Johnson, who was a union general secretary himself, is right to caution that "a return of the union finger jabbers" will be bad for Labour, especially with the centrist voters in the southern half of the country who must be won back if Labour is to return to power.

Labour's intellectual renewal needs to prioritise some serious rethinking about the role and scope of the state. It comes naturally to your party to defend public services. But you will need to ally that with a vision of the state that voters want to rally to and are prepared to pay for.

A narrow, sectarian oppositional stance is not the way back to power. The most attractive feature of the coalition to many voters is that it doesn't seem tribalistic. You will be badly weakened if you can be depicted as the mouthpiece of vested interests. That is the caricature that the Tory press will try to paint. So it will be smart to embrace a pluralist and reformist agenda – which means, among other things, campaigning in favour of the alternative vote. I don't blame you for trying to gather in as many defectors from the Lib Dems as you can get, but you need to do that in a sophisticated way which doesn't shut the door on a coalition with the Lib Dems in the future. It may turn out to be your only means of returning to power.

For many of the fundamentals are forbidding. Labour's share of the vote at the May election was its second worst performance since 1918. The party is broke. As I reveal in the updated edition of The End of the Party, Labour almost had no money to fight the last week of the campaign. It was getting to the point where they couldn't even afford the travel costs of cabinet ministers. Only an 11th-hour cheque from David Sainsbury tided them over.

The party is now almost wholly dependent on the largesse of the trade unions, which leaves you more vulnerable to being painted as their creature.

You told the Manchester conference yesterday: "I know we need to change." When Labour last renewed itself, inspiration and ideas were sought abroad. You won't get much help from your centre-left counterparts in Europe. They are in a terrible mess. Even the most historically successful of those parties, the Swedish Social Democrats, have just gone down to an unprecedented second defeat at the hands of conservatives.

The development of effective policies is necessary, but not sufficient. Wonkery doesn't capture hearts. Elections are won and lost at the emotional level as much as at the rational. It is only in romantic comedy that the geek gets the girl. You have a lot of work to do if you are to develop a resonant voice capable of inspiring a country to believe in you and your idea of the good society.

You may have thought that fighting a brother for the leadership was as tough as it can get. Believe me, that will prove to be a walk in the park compared with what faces you now.

The updated paperback edition of Andrew Rawnsley's bestseller The End of the Party is out now. To order a copy at a special price of £9 with free UK p&p, go to guardianbookshop.co.uk or call 0330 333 6847