What is a good translation for not being attentive? Examples could be:
Je n'étais pas [attentive] dans ma classe de Chimie
Si tu n'étais pas [attentive] sur la rue, tu peux être dans un accident de voiture.
Être attentif works just fine for your first example.
For your second example, faire attention works better.
Être attentif implies attention to something in the sense of concentration, thought, attention to detail, etc. Faire attention is more in the sense of having to be careful, prudent.
You can also use the word "distrait" which is the opposite of "attentif"
For the second example, you can use the word "vigilant" which is much stronger than "attentif".