If you are using Unity C# (which it looks like you are), you might consider putting your code in discussions.unity.com rather than here (I am not a moderator, just a friendly user).
To actually answer your question, you can use Unity's in-built gravity system, which you can access in Project Settings > Physics. This allows you not to build a gravity system from scratch and instead focus on other parts of your game.
Hope this helps!