A large majority of ferns thrive in consistently moist soil high humidity. Make sure to water thoroughly and if possible prevent the soil from ever getting dry. Mixing some sphagnum moss into the dirt and adding terrarium moss to the base of the plant can help to retain moisture.
Remember to give a light misting once every couple days.
Ferns grow on forest floors where there is minimal amounts of light. They thrive in areas that provide small amounts of light throughout the day. If you place a fern in direct light it will cause the fern to slowly yellow and die.
You can also try keeping your fern in a dim lit area and then placing it in direct sun light at some point during the day. This process can be replicated in terrariums by using lights that are set on timers.
Tips & tricks
Ferns are a great add on for bioactive dart frog setups as they require a similar climate. Other plants that grow well with ferns include bromeliads and tillandsia when the right conditions are met.
Remember to wash plants roots clean of potentially harmful fertilizers before adding them to your setup when purchasing from your local garden center.