Let me introduce you to LeetCode , Climbing Stairs. You're climbing a staircase with steps. Each time you can climb or steps. How many distinct ways can you reach the top? Feel free to read the problem, think about it a little bit, and then move on to the next unit! Read the constraints carefully, especially the input size.
This tells you what time complexity you need. Try to find the recursive structure: how does solving smaller instances help solve the full problem?