How do I make my player stick to the ground?

I am trying to make a game where the player is always sticking to the ground no matter how the ground is shaped and is always facing straight away from it, like a magnet I guess?
I hope this is understandable, I am completely new to coding and I have no idea where to start with this. I would really appreciate any help.

Hello,
As far as my understanding of your question, you can do:
-Attach the collider component on the ground and the player

  • add rigidbody component to the player, so the gravity will do the rest.

Hope following physics overview would be helpful,

@anjuman
I tried it this way but I cant get my character to climb slopes properly so I tried a different method without rigidbody. I still dont understand most of it but it works I guess. Thanks for your help