How to make my knitting - FLAT?

I would like to know how to make my knitting stay flat.
for example when knitting a square how to stop the sides rolling in.
This is propably very simple, but if anyone could help me with some instructions please do.
Thank you

Stockinette stitch rolls–the nature of the beast.

To prevent rolling, you need to knit a garter or seed stitch edge.

There is a Sticky at the top of the page that addresses the curling because it’s unavoidable with plain stockinette.

If it is a natural fibre, blocking will stop the rolling, but it may take a long time. It will roll less if you use bigger needles and get a looser fabric. Also choose patterns that are not made in a stitch that tends to roll up.

The sticky can be found here . I also say block it if you can (pinning it down and then steaming/ironing it into shape) or sewing it into the finished project, if it’s a blanket.