On a stove? It's largely about zeroing in on a burner strength that maintains about the right heat, making tiny adjustments as necessary...not turning the burner way up when you need to increase temp, or off when it needs to go down...
Even with that, though, you won't be able to maintain perfect temps on a stove. Shoot for +/- 5*F or so, and try to spend some of the time on both ends of the target temp. You'll get the same result if you oscillate evenly somewhat to both sides of the target temp as if you get it dead on the whole time - at least at mash temps.
For steeping grains, exact temp really isn't all that important, so long as you don't get much above 170*F. All-grain brewers typically have those grains you're steeping in with their mash, which is held at something like 155*F most of the time. So if you're just steeping grains and not mashing, don't worry about what I said before. Heck, just hold it at 150*F if the fancy takes you. Only difference is you need to steep a bit longer to get all the flavor out. Just make sure it hits about 170 near the end, to improve yield.