From the Super Mario Wiki
Hint Blocks, also called Message Blocks, Chatter Boxes, Tip Blocks, and Face Blocks, are blocks with faces that appear in various platformers. They are most prevalent in the Yoshi series. They are usually white, smiling blocks that provide tips and hints to the player when hit.
 Super Mario series
 Super Mario World
Hint Blocks first appeared in Super Mario World, where they usually describe a new level in the beginning stages of the game or explain a new game mechanic. Unlike later appearances, these Hint Blocks have no face in Super Mario World but instead look like speakers.
 Super Mario Bros. Deluxe
In the versus mode of Super Mario Bros. Deluxe blocks known as Hint Blocks appear, despite not providing hints. Two versions of Hint Blocks appear. The white, smiling ones are good, while the red ones, which stick their tongues out, make the level harder. When Mario or Luigi jumps over them, the Outline Blocks disappear or appear.
 Yoshi series
 Super Mario World 2: Yoshi's Island / Yoshi's Island: Super Mario Advance 3
Hint Blocks became more common in the Yoshi series starting with Super Mario World 2: Yoshi's Island, where they teach the player controls and give tips rather than saying things outright. Super Mario World 2: Yoshi's Island gives Hint Blocks their now-common look of smiling white faces. They reappear in the remake Yoshi's Island: Super Mario Advance 3.
 Yoshi's Story
The Hint Blocks return once more in Yoshi's Story. Here they fill the exact same role as they did in Super Mario World 2: Yoshi's Island. Their appearance has changed since then, though, as they are now much bigger, and their mouths continually move.
 Yoshi's Island DS
They return in Yoshi's Island DS and are much the same as before but return to their Super Mario World 2: Yoshi's Island form.
 Super Smash Bros.
Hint Blocks have a cameo in Super Smash Bros.. They appear in the stage Yoshi's Island where one can be seen in the background along with the Super Happy Tree. The same stage also makes a reappearance as playable for the sequel, Super Smash Bros. Melee.
 Super Princess Peach
 Mario & Luigi: Dream Team
In Mario & Luigi: Dream Team, Hint Blocks appear during battle when players are defeated by a boss. They are located next to the other command blocks. They give players hints on the boss's attacks and how to bypass or counter them. They are blue blocks with an exclamation mark in the middle. Once players are defeated by a boss, players should select "try again" and the block appears.