The historic centre is compact enough to explore entirely on foot, which is also the best way to see it — the tiled facades, narrow streets, and sudden squares are all best discovered at walking pace.
For getting to the beaches (Calhau, Ponta d'Areia) or elsewhere in the city, taxis and ride-sharing apps are the most practical option. The bus network covers the whole island but is complex and slow. São Luís's urban sprawl makes distances larger than they appear on a map.
The city is not very cycle-friendly — the streets are steep, the traffic can be aggressive, and there's no meaningful cycle infrastructure. Stick to taxis for anything beyond the historic centre.