As per this Magic Initiate DnD 5E Feat you need to select a class such as; bard, cleric, druid, sorcerer, warlock, or wizard. Being selected any one of those classes you can learn two cantrips depends upon your choice from that specific class’s spell list. Actually, in an addition, simply chose one 1st- level spell for being learning from that same list. By using this dnd 5e feat, you can easily cast the spell once at its lowest level, and also you must be finished a long rest before you able to cast it in this particular way again.
Actually, your spellcasting ability for these spells would be depend on the class that you select such as: Charisma for bard, sorcerer, or warlock; Wisdom for cleric or druid; or Intelligence for wizard.