When you're sewing, the upper thread tension and lower thread tension should be set to the same number. This number is usually between 4 and 6 for most fabrics. If your machine doesn't have numbers, it may have a diagram with different settings for light, medium, and heavy fabrics.
The general rule of thumb is that the heavier the fabric, the higher the tension setting should be. For example, if you're sewing denim or canvas, you'll want to use a higher setting than if you're sewing on lighter weight fabrics like cotton or linen.
If your stitches are too loose, that means your upper tension is too low. If your stitches are too tight, that means your lower tension is too high. You can adjust either one until you get the perfect stitch.
Sewing machine tensions can seem confusing at first, but once you get the hang of it they're actually pretty simple. Just remember to match your upper and lower tension settings and adjust according to the weight of your fabric!