Creating a related post section based on similar categories

look at the Codex chapters which correspond to categories instead of tags:
https://developer.wordpress.org/reference/functions/wp_get_post_categories/
https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters

your code could be re-written to:

<?php
      $orig_post = $post;
      global $post;
      $cats = get_the_category($post->ID);

      if ($cats) {
      $cat_ids = array();
      foreach($cats as $individual_cat) $cat_ids[] = $individual_cat->term_id;
      $args=array(
      'category__in' => $cat_ids,
      'post__not_in' => array($post->ID),
      'posts_per_page'=>3, // Number of related posts to display.
      'ignore_sticky_posts'=>1
      );

      $my_query = new wp_query( $args );

      while( $my_query->have_posts() ) {
        $my_query->the_post();
?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)