Is planing their sides the best way to deal with the crooked boards?
In general yes, planing would be fundamental to how one normally prepares boards for glueing up; preparing long edges would be one of the key reasons for the hand-tool woodworker to own a jointer plane (although it is doable to use shorter planes for this).
Where a power jointer is available taking any sort of irregularity like this out of one edge of a board is one of the things it's specifically for (the other being flattening a board's first face).
Terminology note: edges not sides. Boards have faces, edges and ends. "Side" can be unhelpfully vague because it may refer to a face or edge depending on the board's orientation or position.
Is there an easy way to tell when I've got the edges flat
Up to a point you can learn to sight down boards for a good-enough read on when you have something flat (both faces and edges) but ideally one compares to a known straight edge — either an actual straightedge (made or commercial) or some decent stand-in like a long aluminium level.
In terms of how you get there, in addition to the regular testing against a straight edge/straightedge this is where winding sticks are utilised. Although they don't have to be, winding sticks are pretty much universally shop-made.
![How to make wooden straightedge and winding sticks](https://cdn.statically.io/img/i.sstatic.net/rOjSt.jpg)
Source: Popular Science, Dec 1942
is making the boards match each other so there's no gap all I should worry about?
Sort of, but not generally in the way you're thinking. It's usually the angle of an edge one matches2 rather than planing one edge to match the irregularities of the next (as you might when fitting something to a wall, AKA scribing). Beyond that it's normally dead-straight edge to dead-straight edge.
However, sometimes (rarely) one might deliberately leave a pair of edges slightly hollow for what's called a 'sprung' joint; this is more relevant to hand-tool woodworking than it is to those relying on power tools (where they're not generally needed and harder or impossible to create anyway).
So how close to perfect is close enough?
Because wood is slightly flexible and glue joints are so strong — if done right they ARE stronger than the wood itself (see previous Answers for details) — within reason one can use clamp pressure to close up small gaps between boards when doing a glue-up. There's definitely some judgement required here but a useful rule of thumb is to consider any gap that you can close with hand pressure3 small enough that you don't have to take it out.... although do so if you have the time and gumption because it is better practice.
__
1 Good enough for many purposes. But the higher-end the requirement, or the longer the surface, the more important it becomes to test rather than just rely on a visual read (although you should continue to test/practice this judgement forever if you're a hand-tool woodworker).
2 So for example if one board's edge is 90° the next needs to be the same, but equally if one is 88° the next needs to be 92°; these are referred to as complementary angles.
3 Although it's best if you never leave a gap near the ends because gaps are most likely to open up there over time; counteracting this tendency is precisely what the sprung joint was designed to counter.