Golf has a lot of rules, but only a few of them come up in almost every round you'll ever play. Learn these first.
Before you even tee off
Two habits from the actual Rules of Golf, not just good practice: count your clubs before you start (you're allowed a maximum of 14), and put an identifying mark on your ball. It sounds minor until you're standing over a ball in the rough that could be yours or could be someone else's identical ball, with no way to prove which.
Play the ball as it lies
Wherever your ball comes to rest, that's where you play it from next: in a divot, in the rough, on a slope, all of it. You can't improve your lie by moving the ball, bending grass down, or removing anything growing or fixed near it. The only things you're always allowed to move are loose natural objects like leaves, twigs, and stones, as long as your ball doesn't move when you do.
Count every stroke
Every time you swing at the ball with the intent to hit it, that's a stroke, even if you miss it completely (that's often called a "whiff," and it still counts). Honest scoring is what makes the game work, and it's what your own Scorecard log on this platform depends on being real.
Out of bounds or a lost ball
If your ball goes out of bounds (marked by white stakes) or you can't find it within three minutes of starting to look, the rule (Rule 18.2) is stroke and distance: go back to where you last played from, add one penalty stroke, and play again. It feels harsh the first time it happens to you, but it's the same rule for everyone, every level.
Playing a provisional ball
If you think your ball might be out of bounds or lost outside a penalty area, you're allowed to play a provisional ball right away (Rule 18.3a) instead of walking all the way up to look first, then walking back if it's gone. Just say out loud that you're playing a provisional before you hit it. If you find your original ball in bounds within the three-minute search, you pick up the provisional and keep playing your original ball as if nothing happened, no penalty. If you don't find it, the provisional becomes your ball in play, under the same one-stroke penalty as if you'd walked back. It exists purely to save time, not to give you extra chances.
Penalty areas (red and yellow stakes)
Water hazards and other marked penalty areas use red or yellow stakes. If your ball ends up in one, you get relief options (Rule 17.1d), usually dropping outside the area, roughly where the ball crossed in, for one penalty stroke, rather than being forced to play it as it lies from inside.
An unplayable lie
If your ball is somewhere you genuinely can't play it from (deep in a bush, for example), you can declare it unplayable (Rule 19.1) and take one penalty stroke for a drop nearby, under a few specific options. You get to decide it's unplayable. Nobody else does.
The flagstick can stay in
Since a rules change a few years back, you're now allowed to putt with the flagstick left in the hole, and there's no penalty if your ball hits it (Rule 13.2). You decide whether to leave it in or have someone tend and remove it, but you have to decide before you putt, not after you see which way it's rolling.
Who plays first
On the tee, whoever had the best score on the previous hole plays first (that's called "the honor"). After that, whoever's ball is farthest from the hole plays next. It keeps the group moving in a sensible order without anyone needing to argue about it.