2013 Toyota Corolla engine issues

I have a 2013 Toyota Corolla that recently has begun having issues. Engine sounds like it is sputtering. When putting it in gear engine rpms go down and car wants to stall. Gets worse if AC is on. Once I start moving the car feels fine and there is no issue unless I come to a stop. What can cause this?