How to display an entry on frontend with status disabled if admin is logged in? Something like this?

{% if craft.session.isLoggedIn %}
    {% set slug = craft.request.lastSegment %}
    {% set entry = craft.entries.slug(slug).status(null).first %}
{% endif %}

{{ entry.title }}


But I get error page not found.
If you're specifically checking for the admin, then it's more like:

{% if currentUser.admin %}
    {% set slug = craft.request.lastSegment %}
    {% set entry = craft.entries.slug(slug).status(null).first %}

    {{ entry.title }}
{% endif %}


If you're getting a 404, then it's some other routing issues that is occurring.