This article explains how to send a text message from a computer to an iOS or Android device.
How to Send Text Messages from Computer Using Any Android Phone (Samsung, Motorola, LG, OnePlus)
If you want to send text messages via iMessage on your Mac, here's how to do it.
Sign in to your Mac with your Apple ID.
Use Spotlight Search to find the Messages app, then launch Messages on your Mac.