Fillna value by using the custom logics

how to add the custom function in df.fillna(methods=“my_logic”)
I want to fill NaN values based on the custom logics