If you have never programmed before, how can you tell if you have the talent needed at the professional level?
Even if you did badly in school there is a chance that as an adult you could be successful as a software engineer. The demand for software engineers is high enough that people without degrees in Software Engineering or Computer Science can get into the field. The real question is whether you can solve programming problems and demonstrate it to prospective employers.
The way I got started in programming was an online C class, and C is not a bad place to start. Although, today I recommend “learning Python the hard way” which is available at https://learnpythonthehardway.org/book/intro.html. The book can be accessed for free online but is also available in other formats that you can pay for.
Once you have gotten introduced to the language and can write simple programs with the book guiding you, take a look at Project Euler.
Go to https://projecteuler.net/archives and do 10 of the problems in python. If you can knock out a few problems in a day or two without any programming experience other than the course you are probably capable of professional software engineering. If it takes you a week to get your first problem and only a day per problem after that it might still be worthwhile for you to push forward with Software Engineering.
The Project Euler problems vary in difficulty from easy to rather complicated. Don’t think that you need to be able to do the hardest ones to get a job working as a Software Engineer. But you will find yourself dealing with similar problems on a daily basis so you need to consider if you can handle that being a significant of your daily life and the skill that you get paid for.