To text on both your iPhone and Mac you need to set both of the devices up with the same phone number and same Apple ID.
Check each of the following:
iPhone and Mac both logged in to same Apple ID. Try logging off and logging on if necessary.
iPhone Settings => Messages shows iMessage as "on" (sometimes toggling this off and then on fixes some things)
iPhone Settings => Messages shows Send & Receive showing both phone number and email (Apple ID)
iPhone Settings => Messages shows Text Message Forwarding and your Mac is listed and shown as "on" there.
iPhone Settings => Messages shows Send as SMS "on" and MMS Messaging and Group Messaging both "on"
On the Mac: Messages => Preferences shows same and correct Apple ID and "You can be reached for messages at" indicates both phone number and Apple ID (email), and "start new conversations from" indicates the phone number.
The last one is important to have the phone number indicated on the Mac for "start new conversations" otherwise you will only be able to send texts from the Mac to Apple users of iMessage, but not to non-Apple devices.