In MacOS, if you use the iMessage app, it will automatically determine whether to send a text message or iMessage. To send a message, use the iMessage app. This icon, on the menu bar, looks like the normal texting app on the iPhone. If you want to send a text message, for example to contact someone who is using an Android phone, just start a conversation as you normally would to someone with an iPhone. In your phone (if you have an iPhone), in the iMessage settings, let your mac send text messages through your phone number. After this, you should be able to send iMessages and test messages through your mac.