A basis is orthogonal if its vectors are pairwise orthogonal. A basis is orthonormal, or unitary, if it is orthogonal and all vectors have unit length. The standard coordinate basis is orthonormal. It's easy to make an orthogonal basis orthonormal; divide each vector by its length; assuming the lengths are contained in your field of scalars.
We are given a vector v and a vector x, and we want to project x onto v. That is, how far in the direction of v is x, as measured in units of |v|? Let x = k×v+l×w, where v and w are perpendicular. Take the dot product with v and distribute, remembering that v.w = 0. Thus k = v.x/|v|2. If v is a unit vector, having length 1, k = v.x.
Now assume vi is part of an orthonormal basis. We want to find the representation of x, using this basis. Let x be the sum of kivi, over all the vectors in the basis, and take the dot product of x and vi. Since vi.vj is 0 for i ≠ j, the result is ki. We can find the coefficients of x, relative to this orthonormal basis, by taking the dot product of x with each of the basis vectors.
We tend to concentrate on finite dimensional spaces, but infinite dimensional spaces exist, such as polynomials in x, where the powers of x form an orthonormal basis. Higher dimentional vector spaces are possible, but we shall ignore these for now.
If a (possibly infinite) set of orthogonal vectors spans 0, take the dot product of this linear combination with any vector in the set to show its coefficient is 0. Thus all coefficients are zero. An orthogonal set is an independent set.