For a long time when asked why people liked the games I ran, one of the most common answers I got was that actions had consequences. Looking over my own list of GMs I really enjoy playing in the games for, I've found that they also employ consequences on the regular. It's actually weird to me for their not to be consequences, but perhaps that's because the word is too bland. I mean, after all, getting XP for killing a monster is a consequence. So I guess what I mean is the consequences that these good GMs I know hand out are either meaningful, or otherwise presented in a way to seem unique to the action I've taken.
A World That Notices
The big thing I've found with consequences and players desire for them, is it is a way of signifying that the world is paying attention. Nothing makes a game feel more like a game then never having anyone react to the things you've done. You walk into town in all your Level 10 glory, fighters literally armored in the scales and hides of dragons and everyone covered in more magical items - primarily weapons - than you could find in a magic item store, only for the level 3 guards to still be trying to act like giant bullies. Feels kind of fake, no? Like there's not even a little respect for the fact you're armed and armored, let alone what you're armed and armored with.
Alternatively, and this is one you see in groups with murder hobos, a group of PCs robs, steals, and murders to get what they want - even in town - but are still welcome in inns and there is no search for these bandits and murderers moving about.
Or even bigger, a PC kills their way to a top of a power structure, then has everyone be loyal and view them as a good/reasonable person and not someone who killed their way to the top.
Yes, some of these are more extreme than others. But when the world doesn't react to the stimulus giving by the PCs it is noticed.
The Problem With Railroading
The above examples may feel a little fake or made up - because they are - but most people know about railroading. The thing is railroading gets a bad rap. It is a technique like any other, and it has its uses. The problem with railroading is too much railroading. And the problem with that is...you guessed it, a lack of consequences.
I was in a D&D game somewhat recently where I slowly came to the conclusion that absolutely nothing I did mattered. Nothing I did was going to influence NPCs to change their view (despite a 20+ Charisma and Expertise in Persuasion). Nothing I did was going to influence the plot. And then, worst of all, even doing nothing in combat wasn't going to result in death or a failure condition via combat or other means. Essentially, I could run, walk, or crawl along the tracks through the GM's story, or I could be dragged as my character passed out in combats. No matter what though, we were going along that path.
I don't think the GM meant poorly, nor do I want that GM to feel bad. They were running a game, things were happening, it was interesting...it just also felt like nothing I did as a PC mattered to the game world. Consequently, I stopped caring about the game world which made it very easy to find other things to do once sessions started being missed for IRL scheduling conflicts.
Consequences of All Sizes
The fun thing about consequences is they don't all have to be big. Like the three examples I had above, actions come in all sizes and so can consequences. PCs walking into a city covered in the blood of recent fights and heavily armed/armored could get a different response at the city gate than the PCs would get if they cleaned up first, and especially than if they took the time to peacebond their weapons of their own volition or remove their armor. It's a small thing, but it can make the world feel a lot more alive.
Having people react to what the PCs are wearing, or what the PCs do also helps to sell the world. If a PC is particularly nice while setting up service in an inn, drop a line about how they get good service. If a PC is a jerk about it, mention that other people seem to be getting good service. It shows the world is alive.
As the actions get bigger, so to can the reactions. If a PC murders a shop keep, even if in such a way there are no witnesses, the city/town should still react to the murder. Also, the group of armed vagabonds are going to be chief suspects regardless of witnesses or not.
Even if you have what is happening, or needs to happen next you can flavor the presentation to at least acknowledge what thePCs have done and make it seem like a they've been noticed and it will have the same impact.
Far Cry 5 has this done both well and poor. In my play through I've cleared 1/3 of the map and killed one of the bosses. So it was really weird when I went to the second area, cleared the first story mission, and had the second boss act like I hadn't done the previous 5-10 hours of gameplay. Like, I killed this guy's brother with a shovel and he's acting like I've never done anything to prove I'm even remotely a threat. Then the next story beat has someone giving me their trust because "we heard what you've done down south" and that part felt so much more real and better because even though I know it's just a pretty drape over the rails of the story, the NPC acknowledged what I'd done elsewhere in the game.
Even When The Path Is Set Consequences Can Matter
To end this with a good D&D story, I'm in an online game on roll20. The GM is a first time GM and is running one of the book campaigns. I went in knowing this, and thus expected to have very little to influence except combat and maybe some flavorful RP with the other players. Instead I've been impressed as we move along this big pre-written quest, but the GM has gone and made the world feel alive because he knows to present things in such a way that acknowledges what we've done.
Some of it is little stuff. The Magic Item shop he has in the game world considers us preferred customers and has worked with us on acquiring stuff on account of how much business we've brought them. We have allies that give us more information - or less information - depending on how we've treated them. We're known in some places. We're unknown in others. Towns react to the eclectic mix of races and how heavily armed we are when we arrive.
These are all little things, but they all add up into the illusion that we are the heroes going through this path of adventures, and not just one group of thousands that have gone through the events across the world like some MMO quest.
It feels good. And you can do it in your game by just remembering that actions have consequences, both good and bad, and both big and small. Just present them. Watch how your in game world thrives.