This sounds absolutely appalling, to have been prescribed metformin I assume your HbA1C was quite high though some doctors just reach for the prescription pad regardless, when dietary changes would be sufficient to bring down blood glucose if not too high. The HbA1C is a test which is used to diagnose diabetes and is an average of your blood glucose level over the previous 3 months, a level 48mmol/mol and above will indicate diabetes. How high will determine how much work you need to do with your diet, the metformin just helps the body use the insulin it produces more efffectively.
What should you eat?
Meals based on meat, fish, eggs, cheese, dairy, vegetables, salads, fruit such as berries with only small portions of high carbohydrate foods. Those are things like potatoes, rice, bread, pasta, pastry, tropical fruits. But the things you will want to cut out are cakes, biscuits, fruit juices and sugary drinks.
There are different approaches which people find successful, low calorie, low carbohydrate (that does not mean NO carbohydrate) or shakes-based regime to give a kick start. What will be most suitable for you partly depends on what your HbA1C is, if you have more weight to lose and your lifestyle. But whatever you choose has to be enjoyable otherwise it is not sustainable for the long term. What you are currently doing, not eating is not sustainable.
Have a look at this link for a sensible low carb approach, that means no more than 130g total carbs (not just sugar) per day which for most people is very doable with some good food choices.
https://lowcarbfreshwell.co.uk/
You also need a conversation with your surgery to find your HbA1C result and your cholesterol. Many find that reducing their carbs will improve their cholesterol but as a diabetic they like people to be below 4 so if it is not will prescribe statins. They are usually taken once a day though.