A 73-year-old man presents with palpitations and dyspnoea. He is found to be in atrial fibrillation with a ventricular rate of 170 beats/min. His blood pressure is 80/50 mmHg, he is diaphoretic and confused. Jugular venous pressure is elevated and lungs have bilateral crackles. What is the most appropriate immediate management?