My beloved indoor night blooming cactus is sick
You didn't say how long you have had this plant, but make sure it has a big enough pot, but then it likes to be root bound to flower.
I think you have fungus gnats which are more of a nuisance rather than a detriment to your plants. The small larvae are in the soil and are feeding on the fungi growing in the potting soil, along with some small roots. They are usually more common in soils that are kept too wet and in warm conditions. Fungus gnats are more abundant in old, moist potting soil. As they mature, they turn into small gnats that hang around on the surface of the soil or fly around the plants, especially when the plants are disturbed. Try cutting back on your watering, use yellow sticky traps to trap the adults and prevent them from laying eggs, and if they continue, you can drench the soil with an insecticidal soap or BT product.
Night blooming cereus is a member of the cactus family. It is truly the ugly duckling of the plant world. Move it outdoors and put it under a shade tree each spring, and by mid July through September you will start to see tiny buds produced along the edge of the leaf. Watch their progress daily and within one week the bud will be ready to open that night. Parties have been planned to mark this event. The flowers begin to open when it is truly dark, and produce a seven inch bloom which is gorgeous and fragrant. Once sunlight hits it, the flower is gone forever—each flower only lasts one day. The plant should produce ample buds to open for several weeks once it starts blooming. It usually takes two to three years to begin producing blooms, but when it does, they are spectacular and needs relatively little care inside other than a sunny window and room to grow. Keep it on the dry side each winter, and move it outdoors under a shade tree in late spring. Fertilize monthly from May through July, but make sure you don’t over water or it can rot.
I hope this answers your questions. If you need any more help let me know. Good luck.