Are you asking how to stop your tree from bearing fruit or asking about the reasons why a guava would not fruit? If you asking the latter, then can you describe the health of your tree - are the leaves browning, yellowing or curling, any sign of fungus or disease, or insect pests? How old is your tree? Guava trees have to reach a certain maturity to bear fruit which can take several years, especially if grown from seed. Drought would cause a tree to stop producing fruit.
If you are asking how to stop your tree from bearing fruit - the only real way is to remove the tree.
For more information on the care of guava trees (with guidelines on watering and fertilizing), please visit the following link:
https://www.gardeningknowhow.com/edible/fruits/guava/growing-guava-fruit-trees.htm