How to close humidity sensor at specific humidity
In this code:
void loop()
{
   sample temp and humidity;
   display temp;
   display humidity;

   if humidity &lt;= 50
      LED on;
      buzzer on;
   else
      display temp
      wait 2 sec
   end


There is a missing '}' to to close the if/else.
Why do you display temp twice within the loop?
Where is the logic for the relay and the buzzer at 65%?
Pin numbers for the LED and the buzzer are undefined.
The LED and buzzer pins need to be set to OUTPUT mode in your setup() function.

If I understand your description, you probably need somethng like the following, in your loop function:
   if humidity &lt;= 50
      LED on;
      buzzer on;
   else if hum &gt;= 65%m
      close relay;
      buzzer on;
   end

When I have a problem with program logic that isn't obvious to me, I write it out in pseudo-code as I did above. Once I figure out the logic, then I'll type in C++ with proper syntax.
If I haven't understood your intentions in the above pseudo-code, I'd suggest you do the same thing, until you believe what you've written. Only then try to make it into working code.