How can I get attributes via serialized property?

I created a ConditionalShow attribute, Which basically checks if the other variable in class is true or not, If it is true then draw’s property otherwise doesn’t draw it. But some time the other field also needs another condition, I want to check if condition for the field which is now condition for another field is true or not? if it is false then this field should not be shown.

Here is my code:

// Custom Attribute Class
public class ConditionalShowAttribute : PropertyAttribute
{
    public string ConditionalField = "";

    public ConditionalShowAttribute(string ConditionalField)
    {
        this.ConditionalField = ConditionalField;
    }
}


// Custom Property Drawer Class
public class ConditionalShowPropertyDrawer : PropertyDrawer
{
    public override void OnGUI(Rect Position, SerializedProperty Property, GUIContent Label)
    {
        ConditionalShowAttribute EditCondition = (ConditionalShowAttribute)attribute;
        string PropertyPath = Property.propertyPath;
        string ConditionShowPath = PropertyPath.Replace(Property.name, ConditionalShow.ConditionalField);
        SerializedProperty SourceProperty = Property.serializedObject.FindProperty(ConditionalShowPath);
        bool WasEnabled = GUI.enabled;

       /* Here I need to check if SourceProperty has a ConditionalShowAttribute or not.
        * If SourceProperty Has a ConditionalShow attribute and it is false 
        * then this property should not shown. */

	  if (SourcePropertyValue != null && SourceProperty.boolValue)
        {
		EditorGUI.PropertyField(Position, Property, Label, true);
        }

        GUI.enabled = WasEnabled;
    }
}

// Sample Class
public class Sample : Monobehavior
{
        public bool condition = false;

        // if value for condition is equal to true then will be shown.
        [ConditionalShow("condition")]
        public bool variable1 = true;

        [ConditionalShow("variable1")]
        public string variable2 = "SomeValue";
}

What you are trying to do is what we call reflection which is the process of inspecting and manipulating code with code. In C#, what you are trying to do can be done with the usage of the FieldInfo.Attributes. FieldInfo.Attributes Property (System.Reflection) | Microsoft Learn

Note: A SerializedProperty is NOT the same as a FieldInfo. It is a structure to represent the serialization (process of saving) of a field/property while what you want is the definition of the said field/property.