How to help new-ish players perform less linearly in encounters?

Quick encounter reference guide https://crobi.github.io/dnd5e-quickref/preview/quickref.html has so many possible options for players to take. Even then, the option for diplomacy, roleplaying, and imagination are endless in dnd.

With that said, the last couple homebrew fights have the players attacking first, asking questions later, and just running into the enemies without much thought, rolling off attacks, and using their combat spells in the exact same order each time like a recipe. They don’t even move much in the fight as positioning isn’t a concern for them. Barely surviving but them feeling like “well the fight we either roll well, or die if we roll poorly.” Rather than thinking and trying out other possibilities, utility spells, positioning, imaginative problem solving.

I’ve considered adding environmental obstacles, traps, more dialogue-related enemies, and problems to solve. Maybe them failing, and learning from mistakes is one way to help them learn.

It’s also not just about throwing a bunch of text of them to read, telling them to watch a dnd podcast to get ideas, or adding “new” things, as it is about themselves realising themselves new methods to approach encounters, and trying out new things.

What are some good strategies to help foster this imagination in an organic way that doesn’t involve me telling them to do mandatory homework?