Do Not Disturb is turned on or off by swiping down from the upper right corner of the screen to bring up the control center.
You can mute messages on a Mac with a "Do Not Disturb" setting across your general notifications, or mute individual conversations in iMessage.
If your iPhone speaker is not working, there are some simple ways to troubleshoot possible problems.