I made a lot of mistakes when I first started playing Dungeons and Dragons that made my introductory experience frustrating, confusing, and a big hassle for way longer than it needed to be. That's not to say I didn't enjoy it - I still play my first character in a long-running campaign - but I have definitely had to learn some of the game the hard way.
So, let me help you avoid my mistakes. Here are some tips for new players to help you have fun in your first few sessions.
Play straight first, then try homebrew
When we say that you can be and do anything you want in Dungeons and Dragons, we mean it. You can play as a sapient dog or a sentient plant, you can remake your favorite fictional characters according to D&D stats, you can even play incredible joke characters (I once played a tiefling named Helena Handbask). Homebrew refers to the wild and wonderful creations of the D&D community that supplement the official material and make every table unique.
That being said...
My advice to new players will always be to play something street-legal before they dive into homebrew. Play the "boring" combos from the PHB like half-orc barbarians, human fighters, elf sorcerers, or dwarf clerics for at least your first game. They exist for a reason - they're relatively well-balanced builds with easy reference material that almost every seasoned player has seen at least once, meaning they'll be able to help you make decisions or improve your combat skills if you get stuck.
I'm not saying you can't do homebrew for your first character, or that you can't pull from obscure lore books. I'm saying, as someone who started with a heavily homebrewed character, that it's much harder to have fun playing when everyone around you is debating the rules of your character and saying that you can't do the cool thing because it's overpowered or makes no sense. When you don't know the rules well yet, it's hard to defend yourself in those kinds of arguments and it can lead to a lot of unnecessary stress and frustration. This is a game; let it be fun and start with something that's got established rules so you can build up that knowledge base.
Try melee first, then magic
In a similar vein, I will always recommend that players try melee classes before they try magic.
Magic is part of what makes Dungeons and Dragons so appealing; who wouldn't like to throw a massive fireball into an enemy camp and watch them explode? It's the part of the game that people think of first - sorcerers summoning storms and clerics bringing people back to life and warlocks using otherworldly magic to strike down their foes - and it's true, magic is incredibly fun to play.
But it's also difficult. You have to keep track of your spell save DC and your casting modifier and the spells you have and the slots and levels you have and how many you've already used and when you get them back and the different schools of magic and magical damage types and concentration and saves for half damage and resistances and immunities and about a million other things. There's a common trope that wizards take forever to actually take their turn in combat; the trope exists for a reason. When you're playing a casting character, you have to take way more into consideration before you can do anything at all in combat.
So, I suggest starting simple. Play a fighter, or a barbarian if you want to hit harder. Play a paladin if you absolutely must have magic, or a monk if you're not afraid of keeping track of points. Choose a largely melee class and watch the more experienced casters at work before you play one yourself; it's easier to absorb what's going on around you when you can simply say "I hit it with my sword - TWICE!" and be done with your turn.
That doesn't mean playing melee is boring, though. Melee characters can do some amazing combo moves if you take your turn in the right order! I highly recommend messing around with your turns when they come up to see what you can do to have the most damage, and listening if other players have suggestions for more interesting maneuvers or combos. It's a great way to start building up that multitasking and feature management skill.
Learn to take good notes
It's as cliche as it comes but one of the best things you can do as a new or experienced player or DM for Dungeons and Dragons is learn to take solid notes. Ginny Di has a fantastic video on this:
My personal advice for notes?
Write down important NPC names, races, occupations, and locations. This is especially true if you get value from the NPC such as a quest, a contact, or if they run a store with important items in it.
Keep a copy of the map and note down where you end the session. It's always annoying to forget where you were between sessions!
Note where and when you learn key information - write down the session day, which characters know the info, and what that info is (summarized).
I'll admit that I'm terrible at keeping notes myself; all of my notes tend to happen in the character sheet or in a disorganized notebook if I'm DMing, but trust me when I say that accurate note-writing by players has saved our party more than once.
Don't be afraid to ask questions
To be totally honest, Dungeons and Dragons is a complex and confusing game, especially when you're new. So, don't be afraid to stop and ask questions whenever you need them. No question is stupid; what's obvious to a seasoned player may totally fly over the head of someone new, but seasoned players tend to forget this unless you bring it up to them.
Don't be afraid to ask about how mechanics work, where you are in terms of turn order, what a certain check means and where you can find it, or how certain features work. A good table will be happy to help you figure out how to play your character.
It's also a good idea to ask before you take a risky move. Simply asking the DM, "will that put my character in a lot of danger?" or "Would this make a sound that might alert the enemy?" is a great way to avoid some of the pitfalls of new playerhood. That being said, you should also definitely be prepared to be wrong and mess up - it's how you learn!
Build characters for fun
Build a ridiculous amount of characters. Build an insane, unimaginable number of characters. Build more characters than you'll ever play. Build characters that are optimized for battle, and characters that are optimized for utility, and characters that aren't optimized at all but do have a strict theme. Build multiclasses that are incredibly powerful. Build multiclasses that make no sense at all. Build level 1 characters and level 20 characters and characters with Adventurer's League legal builds and characters built with house rules. Build your favorite fictional character.
Building characters is a fantastic way to learn more about how the classes work with the abilities and the different subclasses available, and helps you get familiar with the structure of the character sheet so that you can find the things you need in-game much faster. It's also a great way to build up a repertoire of characters that you can pull out for one-shots and test battles. Beyond that, it's just good fun!
Dungeons and Dragons is a great way to build your creativity and collaborative abilities while also having fun with your friends doing something a bit silly. If you're brand new to the game, it can feel incredibly overwhelming so take your time, slow down, ask questions, and get familiar with the material. Taking the gameplay experience at your own pace can help you fall in love with the experience of rolling dice and telling a story together.