If you want to attract moths and butterflies to your garden, start by planting flowers. There are many guides that tell you which butterflies are local to your area and which flowers are likely to attract them.
Here are some examples of specific species and the food or flower nectar they prefer.
American copper: Daisy, dandelion, clover, and milkweed.
Clouded sulfur: Clover, dandelion, milkweed, and daisy.
Eastern tiger swallowtail: Bee balm, honeysuckle, and butterfly bush.
Malachite: Rotting fruit, dung, and mud.
Variegated fritillary: Meadow flowers and hibiscus.
You can also leave out small pieces of fruit. Choose fruits high in liquid content like watermelons, strawberries, oranges, and peaches.