“Un” is theoretically pronounced /œ̃/, but is generally pronounced /æ̃/ in today’s Metropolitan French (where “un” rhymes with “copain”). However, the first one (most conservative) is still typical in Quebec (with a bit of diphthongization). If you want to hear the beautiful Quebec pronunciation, italki teacher Caroline made a great video (I don’t have the link, you can ask her: https://www.italki.com/teacher/818092) (Note that the phoneme only occurs in a few words: parfum, commun, emprunter, un, and another one that slips my mind. “Un” is of course one of the most common words in French.)
“Petit” is often pronounced /pti/ in most variants of French. As a general rule, when the E has no accent mark and is the last letter written in a syllable (i.e. not followed by any other letters — including silent letters — in the same syllable), then it is dropped whenever comfortable to do so. By “comfortable”, I mean that dropping it won’t result in too many consonants in a row. (Caroline may have written a relevant article on italki.) Note that in Quebec, “petit” is often pronounced /tsi/, but that’s not really considered standard French.