wordpress thumbnail onclick then modal will come out

Easiest way would be to just grab an existing modal library and enqueue that to your theme. Bootstrap would work (although it would be excessive if you only need a modal window), just enqueue your bootstraps CSS and JavaScript files in your functions.php in your child theme and then you can create the appropriate classes for your modal window. Here are the WordPress codex references on enqueuing:

Enqueue Script

Enqueue Style