I am new to the world of D&D and DMing and would like some pointers. I have little experience l, and I just play with my friends at school. Thank you!
Something I've learnt over my time of DM'ing is that it's best to be prepared and have something set-up that is unshakeable, a single thread that will run along with everything the players do, no matter how... loathe you are to do it. I've had plenty of players go off on some sort of spaghetti-yogurt quest that sent them through the frosty arse-hole of the world, but I let them do it because I've pulled in pieces that shifted where they went.
A few good pointers in my opinion (personal opinion), are the following:
Your players are people of deduction and reasoning, they may not be incredibly smart some of the time and you shouldn't feel bad because they can't figure out a puzzle with about half of it already solved. This line of thinking, that you are playing with people who have some modicum of deduction, reasoning and imagination allows you to follow the 'Less is More' tact. Which is simply explaining a few minute, not overtly important details about an area or room, and letting them think it over themselves. An example of this being; 'You walk into a dull, empty room, the tiles are cracked and filled with a dark mold, each of you instinctively cover your nose and mouth, standing at the entrance as the last of you enter.'
That was one sentence, it tells them that the room is empty - on first glance - and that it is old enough to have black mold (which is deadly when inhaled thus the covering of nose and mouth) and the fact they are all within the room. Nothing more nothing less. Something I find important is that if you have more information about the area the characters are in, you do not verbally hand it off to them, you keep a set of index cards on you and write down the information there, making sure it isn't seen by every damn person playing.
Whoever makes the successful check to find the specific thing you have written down, you give the card to, they can choose to share if they want, this helps chaotic evil, and other such evil characters should they assume the correct, nonchalant demeanor - but this is information for more advanced games.
Another fun little thing you can do; if you can implement it well enough, is have a 'fake-out' trap which would douse one of them in dust or something, something to scare the hero return their thoughts to mortality, for even if they are nigh-immortal, they can still die. It will also teach them to keep a keen eye out.
TL;DR: Less Is More, Use Index Cards, Keep them on Edge.
Be ready to improvise. You can plan for a lot but, your never quite prepared for the moment when one of your players decides to go all in on there play to trick the guards and accidentally gets arrested. Also, if you have a particularly violent group of players.Make your Guards and Shopkeepers a bit tougher. Should help curb that. I also recommend the YouTube channels. Web DM and How to be a Better Game master. Both are informative and helpful.
The most important thing is nearly always to plan ahead, but in a general sort of way. The reason you should do this is because players will just never do what you want. There is nothing you can change about that. So really, the best thing to do is to plan certain story points, but not how you get to them. For example, if your players just escaped a city and want to go somewhere, then you should plan out many destinations, then adjust the difficulty of those places accordingly. Then, if you want them to go to one town, but they go to another, maybe add in some story elements that hint towards the desired location being important. This trick definitely helps with particularly observant or adventurous players, because they are more likely to see and follow more chances for adventure.
Another helpful tip is to make up random NPCs. This can come in handy in many ways. In some cases, it may just be practice until coming up with brief character descriptions becomes second nature. However, you can also sprinkle more thought-out characters throughout the campaign just to spice up the interactions with your players. This definitely keeps players more interested and satisfied with your campaign or adventure.