How to Add jQuery cod in wordpress [duplicate]

use this:

var j = jQuery.noConflict();

now everywhere in script JQurey is needed use j instead of $ or JQuery
also your enqueue line should be like this:

wp_register_script('myjs',get_stylesheet_directory_uri().'/js/my_script.js',array('jquery'),false,true);

wp_enqueue_script('myjs');

you can read more here

P.S: so your updated code should be :

mycustom.js

  var j = jQuery.noConflict();//this line Must be first line of script

j(document).ready(function(){
   j('.flex-active-slide').append('<div class="playoverlay"></div>');
});

functions.php //NOt header.php

<?php wp_register_script('myjs',get_stylesheet_directory_uri().'/mycustom.js',array('jquery'),false,true);
  wp_enqueue_script('myjs') ?>