Almighty Allah says, “Those who guard their sexual organs except with their spouses or those whom their right hands possess, for (with regard to them) they are without blame. But those who crave something beyond that are transgressors.’ (Al-Mu’minoon 23:5-7)
This verse describes those who seek sexual pleasure from other than the lawful means prescribed in the verse as transgressors. Muslim scholars use this as indication to the prohibition of masturbation. Nowadays, we see a variety of other new ways of satisfying sexual need like the sex toys you are asking about. All these ways come under the generality of “those who crave something beyond that”.
Thus, we do advise the husband to have his wife with him and not to stay alone. If not, i.e., if there is no way to have her with him and there is a dire necessity to be away from her, then he should make use of the following:
1- Observing fasting, because it bolsters one’s faith, preserves chastity, and protects one from evil thoughts.
2- Observing moderation in eating and drinking in order to avoid stimulating the desire.
3- Keeping away from anything that is sexually stimulating, such as pornographic pictures, erotic films and love songs.
4- Choosing good and righteous friends.
5- Keeping oneself busy in worship and spiritual acts.
6- Interacting with activities of the society in such a way that it keeps away from thinking about sex.
7- Avoiding gatherings and places that bring men and women physically close to each other.
8- Trying to admire natural things such as flowers and beautiful scenery, which do not stimulate one sexually, instead of admiring girls and women.