It is rather hard to do this and there are very few methods which actually work. One of these is to use the victim's number to send a text message with a link to a website. When they open the link, it will install spyware on their device without them knowing!