Play the long game, but celebrate tiny wins
When starting new things or doing something for the first time, there is often this feeling of making yourself look stupid – after all you have never done it before. However, your willingness to keep at it is a big part of your success. It's important to keep an eye on your long-term goal, even when you fail sometimes along the way.
It's easy to lose sight of the bigger picture when things get tough and you're not making progress as you imagined – especially in the beginning. At the same time I think it is important to deliberately lose sight of the road ahead when you have a small win to celebrate. If you're able to do that, you can gain new motivation and momentum from those small things. For a moment, just forget the long way that is still in front of you and focus on what you achieved right now.
Don't get me wrong, thinking long-term is probably a good idea when building a SaaS product, as they are known to take time building and gaining traction, but that's also why keeping your motivation up with small wins is really important. The longer it will take to reach a point at which you feel really cofortable, the longer you need to be able to keep at it, without big wins along the way. And that means if you're able to focus on the small things that just work out nicely, you're also setting yourself up for long-term motivation.
If you can't motivate yourself
Another thing that works for me when it is hard to keep my motivation up all by myself, is talking to people who are in a similar situation. Find people who are also building a product, who are on the same, long journey as you are. Hearing what they're up to, what they're struggling with and hearing about the good things on their journey can be pretty motivating. Plus you get to learn from their experiences and how they find motivation to keep going.
Finding likeminded people
If you don't know anybody like that, you can always find likeminded people online! Platforms like indiehackers or comunities like Mega Maker are full of talented people who are on a similar journey and willing to share and learn together. Sharing milestones and talking about what you are building gives you a bit of pressure and accountablility, which is a great way to keep on building.