There are official directories for themes and plugins on WordPress.org. Though not every theme and plugin is available there, the ones that are, have been vetted by the community and the review teams. Anything you download from these directories is likely to be relatively bug-free. Plugins and themes that you get from other sources can have malicious code, so be careful. You can also see what the community thinks of these downloads by looking at ratings, comments and popularity metrics:
- You can find the Theme Directory at https://wordpress.org/themes/
- The Plugin Directory is located at https://wordpress.org/plugins/
Following is the screenshot for the WordPress Theme Directory: