Your friend is wrong.
Strategy and tactics are topics that are quite complex even in a game that boils them down to simple numbers like DnD 5e and like any subset of 'what should we do' people often have strong opinions about it. However, the general point of view of most optimizers who have looked at 5e is that the system, with it's strong emphasis on hitpoint damage, lends itself well to use of higher level spell slots as early as possible to lower incoming hp loss (aka, take enemies out of the fight). Negating enemy actions is quite possible in 5e, although requires some ability to judge what kind of saving throws an enemy might excel in, but by far the most popular way to do this is to kill some of the enemies in an encounter, as 'dead' is a pretty good way to stop enemies from attacking (most of the time).
They are also wrong in understanding how D&D works. How someone plays their character and the choices that character makes is their prerogative. That's a fairly ironclad rule of D&D. Characters are not run by committee, each player has their own character and it is their character. People often want to control characters that are not theirs to control, and it is nearly universally considered a bad thing.
Finally, your friend is wrong about berating you. Their goal is to get you to change your behaviour, instead, you view that negatively, and definitely seem to dislike it. They probably think they are being helpful, and that the problem lies with you. However, they are wrong.
Why are they wrong?
A few reasons. Firstly, D&D can be very exciting for people, and is often a new experience, that can lead to relaxing or ignoring social instincts like 'don't berate someone over and over'. Secondly, the complexity of strategy and tactics is often an interesting topic for people and one that they can develop strong opinions about even if they are not themselves an expert in the field. Thirdly, your friend is playing a warlock. In D&D 5e, warlocks gain a very limited number of spell slots (until 11th level, they only get 2) but regain them per short rest instead of long rest.
This will likely be colouring your friend's opinions in a few ways - the scarcity of his own slots makes him value them more, and want to 'hoard' them (a very natural human reaction to scarcity). Likewise, your more numerous (if lower-level) slots will make him naturally envious - you have more options at most points than he does, simply by virtue of having the option to use 3 or more spells in a single encounter. Finally, he may feel that his 'rechargeable' spell slots should be the ones used to defeat encounters if need be, 'saving' yours for situations where he has run out or they are in dire need of use.
The problem there is that he doesn't want to use his own very limited spellslots either. Short rests aren't exactly guaranteed, and wanting to hang onto limited resources until they can be best used is clearly something he is thinking about very strongly.
This is a fairly well known psychological behaviour, hoarding, wanting to expend resources that don't count first, only wanting to use things as a last resort, and the design of the warlock accentuates this trend in a few ways.
What can you do about it?
Polite, but firm.
"I don't think that is the correct strategy to use in this game, but even so, [character name] is my character and I am making the choices that he would make."
Complicated topics like strategy and tactics can be argued over endlessly. There are forums filled with these kinds of arguments, if you need proof. It is complex, even mathematically, to try to model and people often are emotionally invested in one or more parts of it. If you can convince your friend that your approach is valid, then that's great. However, if trying is emotionally taxing, instead indicate that this is a firm no and you are not interested in discussing it further.
"Sorry, but i'm going to keep using spell slots when I think I should. If you want to change character to Wizard and play one your way, you could talk to the DM."
There are a variety of articles, advice, and techniques about being polite but firm online. Some are better than others, but I don't have one on-hand to link. Either way, the advice therein is largely not modified by the setting being a D&D game. The only big change is that you can point to the fact that this is your character, not theirs, and the game is explicit about you being the one to decide what they do (and in fact, that you should be making decisions from the character's point of view and not your own (or his)).
Finally, try to keep in mind that he likely doesn't realize that this is having a strong negative effect on you. Sometimes people genuinely don't care about negative effects on others, for whatever reason, but most of the time people simply don't realize that they are having a negative effect and when this is pointed out to them will modify their behaviour on their own (albeit usually not entirely, but at least partially).