I'll assume you know the fundamentals of Puppet.
Install the Puppet vim syntax highlighter if you're a vim user. Syntax highlighting picks up a lot of typos.
Set up the
Write rspec-puppet tests.
Once all this is set up:
This command will find typos in your files:
bundle exec rake validate
This command will check your code for stylistic issues:
bundle exec rake lint
This command will run your rspec-puppet tests:
bundle exec rake spec
It'll probably be quite a learning curve just to set all of this up if you're a beginner. Once you get there, however, you won't look back.
If all that's too much for you:
Check a manifest file for syntax errors:
puppet parser validate <your_file.pp>
Check an ERB file for errors:
erb -P -x -T '-' <your_file.erb> | ruby -c