I want to make damage calculation that only takes Health, Damage, Resistance. But my code is i must declare the damage calculation manually. Can i make it like Health - Damage - (0.5f * Resistance) instead?

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

public class ObjectStats : MonoBehaviour
{
    public struct Status
    {
        public float Health;
        public float Resistance;
        public float Damage;
        public int Stugger; 
    }

    public Status MainCharacter;
    public Status Enemy;

    void ObjectStatus()
    {
        MainCharacter.Health = 100;
        MainCharacter.Resistance = 30;
        MainCharacter.Damage = 30;

        Enemy.Health = 100;
        Enemy.Resistance = 30;
        Enemy.Damage = 20;

        float damagedeal;
        float resist;
        damagedeal = Enemy.Health - MainCharacter.Damage;
        resist = damagedeal + (0.5f * Enemy.Resistance);
        Debug.Log(resist);
    }

    void Update()
    {
        if (Input.GetKeyDown("f"))
        {
            ObjectStatus();
        }
    }
}

First your code looks bad.
You must be new to programming.
if you are dealing dmg to the enemy the code should be something like this.

Enemy.Health = Enemy.Health - MainCharacter.Damage * (0.5f * Enemy.Resistance);

Next time give more information of what you want to do as I am not sure if I used the right formula to calculate the dmg.