how to stay motivated?


Instead of being motivated, you should just accept whatever that is given either a win or loss. Keep your cool instead of searching motivation.
If you win or draw, rejoice.
If you lose, analyse to learn from your loss and win or draw in the future.

Take it step by step, don't overwhelm yourself. Play a game and study it afterwards. Just get something to take away from it. Maybe it's an opening variation or a tactic that you weren't familiar with. It could be something positional or anything. Play to learn something and have fun.
You could basically get peers of similar rating points to study in a group together! I think the competition will keep your morale alive.
Though this will depend on the COVID restrictions in your country.

We just need to learn from mistakes, and to put that learning into practice. Re frame your mistake as an opportunity to learn and develop. Review what went wrong, to understand and learn from your mistake. Identify the skills, knowledge, resources, or tools that will keep you from repeating the error. Review your progress.

Hi! My name is Lauren Goodkind and I’m a respected chess coach and chess YouTuber based in California:
https://www.youtube.com/channel/UCP5SPSG_sWSYPjqJYMNwL_Q
Perhaps hire a chess coach to motivate you.
I hope that this helps.
When you lose motivation, you are no longer having fun or enjoying the experience. If I have no motivation to do something, I just don't do it. So enjoy the game the best you can, and if you are having trouble finding the motivation to keep playing, then take up another hobby. No point in continuing if it doesn't make you happy anymore