I want to rotate my character 180 degrees when walking to the opposite direction in 2D

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
public Animator animator;
private Rigidbody2D rb;
private bool moveLeft;
private bool moveRight;
private float horizontalMove;
public float speed = 5;
public float jumpSpeed = 5;

// Start is called before the first frame update
void Start()
{
    rb = GetComponent<Rigidbody2D>();

    moveLeft = false;
    moveRight = false;
}

//I am pressing the left button
public void PointerDownLeft()
{
    moveLeft = true;
}

//I am not pressing the left button
public void PointerUpLeft()
{
    moveLeft = false;
}

//Same thing with the right button
public void PointerDownRight()
{
    moveRight = true;
}

public void PointerUpRight()
{
    moveRight = false;
}

// Update is called once per frame
void Update()
{

    
   
    animator.SetFloat("Speed", Mathf.Abs(horizontalMove));

    MovementPlayer();
}

//Now let's add the code for moving
private void MovementPlayer()
{
    //If i press the left button
    if (moveLeft)
    {
        horizontalMove = -speed;
    }

    //if i press the right button
    else if (moveRight)
    {
        horizontalMove = speed;
    }

    //if i am not pressing any button
    else
    {
        horizontalMove = 0;
    }
}

public void jumpButton()
{
    if(rb.velocity.y == 0)
    {
        rb.velocity = Vector2.up * jumpSpeed;
    }
}

//add the movement force to the player
private void FixedUpdate()
{
    rb.velocity = new Vector2(horizontalMove, rb.velocity.y);
}

}

If you just want to flip characters sprite visually to the other direction you can use GetComponent() and set the property SpriteRenderer.flipx according to your Horizontalmove or rb.velocity.

If you want to flip the whole object horizontally you can set the transform.localScale = new Vector3(-1,1,1);

if you want a 180 degree rotation set rb.rotation = 180f; when moving left and rb.roation = 0f; when moving right