SELECT * is bad practice because it is most expensive to query data when you need only a couple of columns. If you want to retrieve only a few columns of that table then using SELECT * is just the additional and unnecessary work for the database server. Using SELECT * when needed only specific columns lead to unnecessary information that has to be passed over the database server. This consumes more processing time when you have huge data.
If you wish to learn to write optimal SQL queries, you can check out this SQL Training course by Intellipaat.