I suggest thinking non-player characters, places and objects rather than encounters.
Since you write about "dm" and have "dm tips" as a tag, I assume you are running some edition of Dungeons and dragons. This does not yet tell much, as every edition of it is a very different game. The approach I suggest here should work with most of them; maybe not so well with fourth edition.
Dangers, treasures, characters
You are running a game in cooperation with several other people. You have a different role than the others, but, ideally, this is still a cooperative effort.
I suggest your role in this cooperative effort is to create fantastic places, items, magical effects, etc., as well as strongly motivated non-player characters that might or might not be monsters. The characters should have conflicting goals and they should be pretty obvious, but the players have to have some freedom in whom they agree and disagree with, for and against whom they ally. Places should be on a map and items somewhere or with someone.
In play, you let players choose where to go, describe what is there, and play out the non-player characters both on the screen and off-screen. By "play" I mean you decide what they do based on their motivations and capabilities.
What happens is that you will get several different types of situations. You don't know what they will be, exactly, because you have not created them. Some stuff you prepared will not be seen, while some other stuff will have seen much more play than you expected. Much of the actual content will be emergent. Techniques like random tables and reaction rolls are very helpful.
So: don't plan encounters, plan a small piece of a varied and fantastic world.
Place adventure locations with interesting fictional content into your small but growing sandbox world. You know best what kind of content you find interesting; I am partial to a lot of stuff moving around in the OSR spheres, myself, as I find it to be full of new ideas. Even a few such ideas can carry a campaign, since they will take life when players interact with them in a sandbox context and this binds them together, creating new and interesting situations and problems. Consider, for example, the false hydra: https://goblinpunch.blogspot.com/2014/09/false-hydra.html