Hello,
There are several ways to text someone who has a cellphone, only by using your computer.
Supposing you're using a MacBook, and your friend an iPhone, you can both use the built-in Messages/iMessage app on these Apple devices. Although, you may need to
set up Messages/iMessage with your Apple ID.
If that's not the case or isn't possible, use other online texting platforms like Messenger, Discord, Twitter, etc... They offer texting and private messaging without requiring a mobile number.
Hope this answers your question.