Are you sure it's stuck, or not just finished? A beer can be stuck usually if the temp suddenly drops to the yeasts dormancy/flocculation point. So swirling warming does indeed work. Or rarely the yeast tires out, and swirling it back into suspension will help bring it down a few more points.
But what most new brewers think is a stuck fermentation is usually a matter of the yeast eating all the fermentables and finishing high, like what we call the 1.020 or 1.030 curse. If you mashed too high and got a lot of unfermentables, or in the case of extract, a lot of unfermentables/caramelization. Nothing you can do short of maybe adding an alpha amalaze to "break" the unfermentable sugars down will work.
Swirling won't, warming it up won't, heck even adding more yeast won't. A beer can be done high, and nothing's really wrong.
For example I have a barleywine that is FINISHED at 1.040. The og was 1.170 and it has a lot of caramel malts and extremely dark (50 year old) honey in it. That dark translates into unfermentable sugars. It's been multiply yeasted, and has been sitting in a tertiary for close to two years. Despite the numbers it is finished, NOT STUCK, there's just nothing left for the yeast to eat.
Is this an extract beer? There's what is known as the 1.020 curse, where a lot of extract batches tend to peter out at that point. Making sure you have put in plenty of oxygen and yeast on brew day helps. But some beer seem to stick regardless. A lot of that I think has to do with wort caramelization, where both the process of making and boiling the extract produces or converts some of the sugars into unfermentable ones.