A wide assortment of herbs, greens, lettuces, edible flowers, and even chili peppers will produce better than expected on a sunny windowsill, especially during the summer months when the days are longer and the light is more intense. In the absence of a sunny window you're going to need a little help in the way of an artificial grow light, but even that can be as simple as a full-spectrum bulb in a cheap shop light.
Chances are that your windowsill garden isn't going to stay alive forever, even indoors. To keep plants happy for the longest time possible, be sure they are getting good drainage, ample water, and as much light as possible. Water when the soil has gone from damp like a sponge to slightly dry within an inch of the top. How often you need to water depends on the location, because pots set on a hot and sunny window situated above an electric baseboard heater are likely to dry quickly, whereas those set in a north-facing window with a draft may retain moisture for up to a week. Always sample the soil moisture an inch or so below the surface with your finger before pouring on more water.
Increase the humidity around the leaves during the dry months by setting pots on top of a tray of pebbles or spritzing the air with a water bottle.
Pest prevention and maintenance
Hold back on fertilizers during the slow-growing winter months. With short days and little sun, plants will grow leggy and fragile. Cut your plants back regularly to encourage stocky, bushy growth.
When growing in a mixed pot or window box, choose plants with similar needs. Mediterranean herbs such as oregano, marjoram, sage, and thyme that love lots of sun and good drainage are a guaranteed mix. Lettuce greens also grow well together, but it's best to give hot peppers their own pot.
For indoor growing, most herbs are easiest and fastest if started from transplants. Basil, calendula, violas, pansies, and coriander are the exception, growing to an edible size quickly from seed. When it comes to leafy greens and lettuce, seeds are the only way to go.
Window boxes are the obvious choice because their thin, boxy shape is tailor-made for windowsills. However, there are all kinds of fashionable options these days, including individual square pots like the one depicted. Window boxes and pots should be a minimum of 5" deep with drainage holes and water-catching trays that fit neatly underneath. The deeper the pot, the better your bet for keeping the plants healthy over the long term. Containers without holes can be adjusted with the addition of an inch or two of gravel or broken pot shards placed at the bottom as a water reservoir. This method will work over the short term but requires some restraint when watering to avoid drowning the plants.