Trump nominated Nikki Haley and she was voted in through that process in early 2017 to the United Nations as the United States ambassador to the United Nations. It is unknown at this time why Nikki Haley resigned although it is known that this position at the UN is not one that many people want. Also, spending her first year doing this job where she is in charge would be difficult.
Many people believe that this position is highly stressful. As far as ulterior motives for her resignation, only time will tell. It was believed that she resigned in order to campaign for election to the presidency in 2020, but she dismissed those claims. She probably needed time to spend with her family and relax from such a stressful job.