Joshua 1:8shamar
"This book of the law shall not depart from your mouth, but you shall meditate on it day and night, so that you may be careful to do according to all that is written in it; for then you will make your way prosperous, and then you will have success.
Meditating on God's law leads to being careful to do it.
Ezekiel 20:21shamar
"But the children rebelled against Me; they did not walk in My statutes, nor were they careful to observe My ordinances, by which, {if} a man observes them, he will live; they profaned My sabbaths. So I resolved to pour out My wrath on them, to accomplish My anger against them in the wilderness.
Israel's failure to be careful to observe God's ordinances brought judgment.
Deuteronomy 6:3shamar
"O Israel, you should listen and be careful to do {it,} that it may be well with you and that you may multiply greatly, just as the Lord, the God of your fathers, has promised you, {in} a land flowing with milk and honey.