The first part is how much does SEO cost and the second part is how much should you spend on Learn how to practically build a successful website or blog.
You can learn it free online. But if you need guidance you can join some good seo institute or work as trainee in some local seo & digital marketing company . I learnt SEO while working in one of local SEO Company
The online cost is time. you know that you can not bring a website to top in just 1 or 2 minutes, it is a long progress, and you can't make sure whether what you are doing is right or wrong, so it may take your time to try again and again
You can learn basic SEO at free of cost through free online tutorials platforms, there are lot of educational websites are available on the web, who teach each an every techniques of SEO step by step.