When starting, your first goal is to reach level 16 - that is when you can first join a guild. At lower levels, you should simply advance level whenever you have enough experience. You can optionally spend some experience on the racial skills, but this is never essential.
The help levels help page explains the concept - whenever you do advance level, you gain one free level. You can then "spend" the level on levelling up a guild of your choice. If you are familiar with the 3rd edition of D&D, it's very similar.
Each guild requires a particular background - for example, you need to select the nomad background to join the rangers. You cannot mix guilds from multiple backgrounds. Some guilds are available in two backgrounds.
The level cap is 100 (ascension levels exist, but you needn't worry about those for now), and with 15 levels not usable for guilds, you get a total of 85 levels to spend on guilds. Now, it is recommended to pick one guild and focus on it all the way to the top - most guilds offer their good skills and spells at the highest levels. Most guilds require 30 levels to max out.
Remember that levels are useless without skills and spells - these are trained with experience as well. How to best spread out your experience between levels and skills/spells varies depending on your chosen guild and preferences. A good approach is to train the most important skills/spells only after each level-up, focus on reaching the max level of your guild, then pad out the missing bits.
Note that experience costs for training levels increase rapidly - it's about 4M to get to level 45, 35M to get to level 70, but reaching level 100 requires about 320M experience (doing level quests can reduce this somewhat). Add skill/spell costs on top, and you are going to be here for quite a while before you reach level 100. As such, it is best to focus on a single guild for now, and later on two (when you can reach level 70-80).
When training skills and spells, two important numbers are your racial skillmax and spellmax. These are a soft-cap on how high you can train skills/spells - you can train above this number, but at a much higher experience cost. It's also worth noting that depending on your background, you get bonuses to certain skills, allowing your effective skill% to go above 100. While this can be useful, early on it is better to place experience elsewhere instead.