Fireflies and other insects are easy to care for under basic conditions. Before catching a pet firefly, make sure that you have a suitable, clean container and mechanisms for feeding the insect. Fireflies can make great pets for a few weeks, but have a short life span and should be released in a timely manner.
Construct a suitable container for fireflies that has room for the insects to fly around. Ensure that the insects are constantly aerated by poking holes in the container or using a mesh container.
Provide fireflies with some natural habitat such as branches and leaves to give them a place to sit and rest.
Keep the environment free of mold, mildew and feces by removing the fireflies to clean it once a week or when it becomes dirty.
Provide fireflies with a shallow water dish containing fresh water. Change the water out daily even if it has not become empty.
Offer a captive firefly sugar water as a substitute for nectar, the main source of food for fireflies. If desired, place small meal worms or other soft-bodied insects as prey periodically.
Keep the firefly container out of direct sunlight, which will make the environment too hot and dry. Keep the container at room temperature with exposure to indirect light.
If all of your fireflies die immediately after being given access to fresh air and fresh water, clean the entire container thoroughly with Lysol or common bleach as it may be contaminated. If you intend to keep a firefly for an extended period of time, consult a book on insect care to ensure that you provide optimal conditions for the entirety of the insect's life cycle.