Not knowing exactly what you have tried so far, please bear with me if I repeat anything.
You first need to add a phone number to be used for iMessages on your iPhone. Ref: Add or remove your phone number in Messages or FaceTime - Apple Support
Note that this will only work with the phone number that belongs to an iPhone. If the phone number that you want to
add belongs to an iPhone that you can't access, change your Apple ID password. This removes all phone numbers from your iPad, iPod touch, and Mac. Calls or messages for the removed numbers won't appear on those devices anymore.
You may also find the following article helpful: How to Change the iMessage Phone Number on iPhone - iGeeksBlog