select an object with the mouse and then rotate it

hello

I have windmills that when i press the mouse it spawns an windmill at that location. What i want to do is when i press the windmill with the mouse again i can rotate the windmill with the arrow keys but how do i do that.
I have this script for instantiation.

Can someone help me?

using UnityEngine;
using System.Collections;

public class windmolenmuis : MonoBehaviour
{
    public GameObject windmolen;

    public bool windmolenplaatsen = false;


    void Update()
    {

        if (Input.GetKeyDown(KeyCode.F))
        {
            windmolenplaatsen = !windmolenplaatsen;
        }

        Vector3 mousePos = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f);

        if (Input.GetMouseButtonDown(0))
        {
            if (windmolenplaatsen == true)
            {
                Vector3 wordPos;
                Ray ray = Camera.main.ScreenPointToRay(mousePos);
                RaycastHit hit;
                if (Physics.Raycast(ray, out hit, 1000f))
                {
                    wordPos = hit.point;
                }
                else
                {
                    wordPos = Camera.main.ScreenToWorldPoint(mousePos);
                }
                Instantiate(windmolen, wordPos, Quaternion.identity);
                //or for tandom rotarion use Quaternion.LookRotation(Random.insideUnitSphere)
            }
        }
       

    }
    void OnGUI()
    {
        if (windmolenplaatsen == false)
        {
            GUI.Box(new Rect(100, 0, 130, 50), "windmolen draaien");
        }
        if (windmolenplaatsen == true)
        {
            GUI.Box(new Rect(100, 0, 130, 50), "windmolen plaatsen");
        }
    }
}

You create a windMill rotate script that rotates your stuff and attach it to the windmill prefab (make it disabled by default).
When you click, cast a ray into the scene, if it hits the ground spawn a windmill; if hits a windmill, activate the windMillRotate script on that windmill.
Something like (pseudocode):

 Ray ray = Camera.main.ScreenPointToRay(mousePos);
    RaycastHit hit;
    if (Physics.Raycast(ray, out hit, 1000f))
    {
        if (hit.collider.name == "floor") {
          wordPos = hit.point;
          CreateWindmill(wordPos);      
     } else {
         hit.collider.GetComponent<windmillRotate>().SetActive(true);
     }
     }

hi when i putt the script you saied in the script i already have. i got alle kinds of errors that the variables are not defined